openapi: 3.1.0
info:
  title: JeraSoft Billing API
  version: 3.27
security:
- ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: Token for API access
  responses:
    InternalError:
      description: An unexpected error occurred
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: An unexpected error occurred
      required: true
    Unauthorized:
      description: Access is not authorized
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  message:
                    type: string
                    example: 'utoken-auth-failed: Authentication Failed: IP 10.0.0.1
                      is not allowed'
                  data:
                    type: object
                    properties:
                      code:
                        type: string
                        description: Error code
                        example: utoken-auth-failed
                      message:
                        type: string
                        example: 'Authentication Failed: IP 10.0.0.1 is not allowed'
      required: true
    LogicalError:
      description: A logical error occurred, making the request unprocessable
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: 'invoices-zero-amount: Impossible to create an invoice
                      with zero amount'
                  data:
                    type: object
                    properties:
                      code:
                        type: string
                        description: Error code
                        example: invoices-zero-amount
                      message:
                        type: string
                        description: Error message
                        example: Impossible to create an invoice with zero amount
      required: true
    ObjectNotFound:
      description: Requested object was not found
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  message:
                    type: string
                    example: 'not_found: Object "clients(123)" was not found!'
                  data:
                    type: object
                    properties:
                      code:
                        type: string
                        description: 'Error code (static: `not_found`)'
                        example: not_found
                      message:
                        type: string
                        description: Error message
                        example: Object "clients(123)" was not found!
                      object_name:
                        type: string
                        description: Type of the object
                        example: clients
                      object_id:
                        type: string
                        description: ID of the object
                        example: '123'
      required: true
    BadRequest:
      description: The request contains invalid arguments or is malformed
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Invalid request
                  data:
                    type: object
                    example:
                      name: Empty value is not allowed
                      payment_terms_id: Object "payment_terms(123)" was not found!
                    description: Details for validation errors (if applicable)
      required: true
tags:
- name: clients.accounts
  x-displayName: Accounts
  description: 'Client accounts associate calls and events with a specific client
    using

    various identification methods (IP address, username, user ID, or party

    ID such as ANI/DNIS).


    ### Origination and Termination


    Accounts determine if the client is allowed to **originate (initiate)**

    and **terminate (receive)** calls or events. Origination and termination

    settings are used to configure each direction respectively.


    ### Role and purpose


    Accounts participate in the AAA (Authentication, Authorization, and

    Accounting) flow, rating, billing, and dynamic routing.


    ### Service differentiation


    Accounts allow defining **different product levels and rates** for the same

    client (e.g., quality-based differentiation using technical prefixes).'
- name: aaa.sessions
  x-displayName: Active sessions
  description: 'The package is responsible for tracking active sessions in real time,
    which is

    essential for applying capacity restrictions within authorization and routing.


    ### Key features


    * Enables **real-time tracking** of active sessions.

    * Helps manage system **capacity restrictions** related to authorization and routing.


    :::tip


    Active sessions are not used for generating event detail records (xDRs). If you

    need to store xDRs, refer to the *"xDR Processing"* package.


    :::'
- name: reports.active_sessions
  x-displayName: Active sessions
  description: 'Active Sessions allows querying real-time data about currently active
    sessions.


    ### Key features


    * **Real-time data** on active sessions from RADIUS accounting or API.

    * **Extensive filtering, grouping, and slicing** with post-aggregation options.


    :::tip


    To ingest active sessions via API, refer to the *"Events processing & control
    /

    Active sessions"* section.


    :::'
- name: rates.agreements
  x-displayName: Agreements
  description: 'Agreements allow you to manage rate agreements for customers and vendors,

    ensuring consistency and compliance in pricing structures.


    ### Key features


    * **Manage rate agreements** for both customers and vendors.

    * **Verify imported vendor rates** against existing agreements.

    * **Generate customer rates** aligned with contractual agreements.'
- name: routing.analysis
  x-displayName: Analysis
  description: "Routing analysis provides real-time insight into the system's routing\
    \ logic.\nIt allows querying the routing map and simulating routing decisions\
    \ to\nanalyze available routes, rejected routes, and applied rules.\n\n### Key\
    \ features\n\n* Displays the list of **available routes** based on the current\
    \ routing plan\n  and vendor conditions.\n* Identifies **rejected routes**, explaining\
    \ the reason for rejection and the\n  rule that caused it.\n* Useful for **debugging\
    \ unexpected routing behavior** or optimizing routing\n  configurations."
- name: rates.analysis
  x-displayName: Analysis
  description: 'Analysis provides insights into available rates, helping you compare,
    simulate,

    and optimize rates for better business outcomes.


    ### Key features


    * **Compare rates** from different vendors to identify cost efficiencies.

    * **Simulate breakout lists** from shorter codes for comprehensive analysis.

    * **Build LCR (least-cost rating) lists** to optimize routing.

    * **Analyze margins** between customer rates and vendor costs.'
- name: system.audit_log
  x-displayName: Audit log
  description: 'The package provides access to detailed records of system events and
    changes.


    ### Key features


    * Tracks system entity **modifications** for transparency.

    * Provides **historical records** of actions performed.

    * Enhances traceability for compliance and debugging.'
- name: aaa
  x-displayName: Authorization
  description: "The package handles both client authentication and event authorization.\
    \ It\nensures that client devices are allowed to connect to the platform and\n\
    verifies that events like calls or messages are allowed based on service\npermissions\
    \ and account balance.\n\n### Key features\n\n* **Authenticates client** equipment\
    \ connections (e.g., SIP phone registration).\n* **Authorizes client-initiated\
    \ events**, ensuring service eligibility and\n  sufficient balance.\n* Supports\
    \ **multiple event types**, such as calls, messages, and other service\n  requests."
- name: iam.auth.jwt
  x-displayName: Authorization / JWT
  description: 'The package provides functionality for issuing and refreshing JWT

    tokens used for API authentication.


    :::warning Deprecated


    JWT-based authentication has been replaced by API keys.


    :::'
- name: clients.notes
  x-displayName: Client notes
  description: "The package allows adding and tracking notes related to clients. These\
    \ notes\nare useful for storing historical comments, internal remarks, or any\
    \ other\nrelevant information, helping to maintain a detailed record of client\n\
    interactions.\n\n### Key features\n\n* Add **free-form text** notes with optional\
    \ **file attachments**.\n* Notes are visible to system users to assist in tracking\
    \ client-related\n  information over time.\n* Useful for documenting client interactions,\
    \ internal decisions, or additional\n  context.\n* Managed directly by system\
    \ users for flexible and comprehensive client records."
- name: clients.templates
  x-displayName: Client templates
  description: 'Client templates allow defining **reusable parameter sets** for new
    clients,

    ensuring consistency and reducing manual input.


    ### Key features


    * Empty fields **inherit values** from the template when a new client is created.

    * Any changes to the template **immediately** affect all associated clients.

    * Streamlines onboarding for similar customer types.

    * Ensures default settings and parameters are consistently applied.'
- name: clients
  x-displayName: Clients
  description: "Clients in JeraSoft Billing represent both customers and vendors.\
    \ They are the\nprimary financial entities in the system, responsible for tracking\
    \ balances,\ninvoices, payments, and charges.\n\n### Customers vs Vendors\n\n\
    * Associated client accounts determine if the client is allowed to\n  **originate\
    \ (initiate)** and **terminate (receive)** calls or events.\n* Origination rate\
    \ tables define **charges applied** when a client consumes\n  services.\n* Termination\
    \ rate tables define **payments credited** when a client provides\n  services.\n\
    \n:::tip Negative rates\n\nRates can be negative to invert the transaction nature,\
    \ such as charging for\nreceiving calls or events by customers.\n\n:::"
- name: system.nodes
  x-displayName: Cluster nodes
  description: 'The package provides insights into the status and replication health

    of system nodes.


    ### Key features


    * Monitors **node connectivity** and synchronization.

    * Ensures proper **cluster functionality**.'
- name: configuration.codes
  x-displayName: Codes
  description: 'The package is used to manage codes within Code Decks. Each code definition

    besides the code itself includes a name, and an associated country name.

    These code definitions are essential across the system for rate definitions,

    reporting, dynamic routing, and more.


    ### Key features


    * Manage codes with associated names and countries.

    * Codes are utilized in rate tables, dynamic routing, and reporting.'
- name: configuration.codes.decks
  x-displayName: Codes / Decks
  description: 'The package allows you to manage Code Decks, which are extensively
    used across

    the system to define naming within rate tables, dynamic routing, reporting,

    and more.


    ### Key features


    * Essential for **consistent naming** in rates and reports.

    * Create and organize Code Decks for system-wide usage.


    :::tip


    To manage individual codes within these decks, refer to the *"Codes"* package.


    :::'
- name: system.collectors
  x-displayName: Collectors
  description: 'The package retrieves information about available collectors used
    for

    system integrations.


    ### Key features


    * Lists **available collectors** in the system.

    * Supports defining **equipment interactions** in "Integrations / Equipment".'
- name: integration.credentials
  x-displayName: Credentials
  description: 'The package allows you to manage credentials for external systems
    such as

    equipment, mail servers, and other integrations. These credentials are

    essential for configuring connections for tasks like downloading CDR

    files or managing mail server communications.


    ### Key features


    * Manage **connection types** such as SSH, FTP, and SMTP.

    * Store **authentication details** securely.

    * Simplify integration setups by centralizing credential management.'
- name: accounting.currencies
  x-displayName: Currencies
  description: 'The package allows you to manage currencies available in the system.
    Currencies

    are used throughout the platform to define rates, subscription fees, generate

    invoices, process transactions, and so on.


    ### Key features


    * Manage and configure **all available currencies** within the system.

    * Define **numeric precision** for each currency (number of decimal places).


    :::tip


    To define exchange rates between currency pairs, refer to the

    *"Currencies / Rates"* package.


    :::'
- name: accounting.currencies.rates
  x-displayName: Currencies / Rates
  description: 'The package allows you to manage exchange rates between various currency
    pairs.

    It supports maintaining historical exchange rates for accurate financial

    calculations and uploading current rates for real-time billing accuracy.


    ### Key features


    * Manage **exchange rates** between different currency pairs.

    * Store **historical exchange rates** to ensure precise billing calculations.

    * Upload **real-time exchange rates** through the API to maintain billing accuracy.'
- name: iam
  x-displayName: Current user
  description: 'The Current User package provides information about the currently
    authenticated

    user.'
- name: iam.profile
  x-displayName: Current user / Profile
  description: 'The package allows users to manage their personal settings and

    authentication details.


    ### Key features


    * Update user preferences.

    * Change the password for authentication.'
- name: dids.custom_fields
  x-displayName: Custom fields
  description: "Custom fields allow defining and managing structured additional parameters\
    \ for\nDIDs. These fields extend the standard DID data model.\n\n### Key features\n\
    \n* **Store additional structured information** such as external IDs,\n  DID-specific\
    \ details, or integration-related data.\n* **Accessible via API or Web UI** for\
    \ querying and updating.\n\n:::tip Field definitions\n\nThe list of the available\
    \ custom fields is managed in the *\"Custom Fields\nManagement\"* package.\n\n\
    :::"
- name: clients.custom_fields
  x-displayName: Custom fields
  description: "Custom fields allow defining and managing structured additional parameters\
    \ for\nclients. These fields extend the standard client data model.\n\n### Key\
    \ features\n\n* **Store additional structured information** such as external IDs,\n\
    \  client-specific details, or integration-related data.\n* Can be used in the\
    \ **invoice templates** to add additional details.\n* **Accessible via API or\
    \ Web UI** for querying and updating.\n\n:::tip Field definitions\n\nThe list\
    \ of the available custom fields is managed in the *\"Custom Fields\nManagement\"\
    * package.\n\n:::"
- name: packages.custom_fields
  x-displayName: Custom fields
  description: "Custom fields allow defining and managing structured additional parameters\n\
    for packages. These fields extend the standard package data model.\n\n### Key\
    \ features\n\n* **Store additional structured information** such as external IDs,\n\
    \  package-specific details, or integration-related data.\n* **Enhance package\
    \ customization** by adding specific fields tailored to\n  business requirements.\n\
    * **Accessible via API or Web UI** for querying and updating.\n\n:::tip Field\
    \ definitions\n\nThe list of the available custom fields is managed in the *\"\
    Custom Fields\nManagement\"* package.\n\n:::"
- name: dids
  x-displayName: DIDs
  description: 'The DIDs package allows for the management of Direct Inward Dialing
    numbers

    (DIDs), including automation of workflows such as activation and assignment

    to customers.


    ### Subscription-based allocation


    DIDs can be assigned to clients based on the **quantity and tags** allowed

    by their subscriptions (packages).


    ### Operators


    * Each DID is assigned to a specific operator, who provides the DID.

    * Operators are managed separately in the "Operators" package.


    :::note Lifecycle


    The lifecycle of the DID is managed by the *"Packages manager"* system

    service according to the status of the corresponding subscription.


    :::'
- name: system.database
  x-displayName: Database info
  description: 'The package provides real-time insights into the database instance

    running on the queried node.


    ### Key features


    * Monitors database health and performance.

    * Retrieves instance-specific details for better diagnostics.'
- name: integration.download_logs
  x-displayName: Download logs
  description: 'Download logs provide insights into the operation of the "Files Downloader"

    system service, which retrieves xDR (CDR) files from external systems.

    These logs help monitor and troubleshoot file downloads for subsequent

    processing by the "Files Collector."


    ### Key features


    * Track **all retrieved files** along with their metadata.

    * Monitor the **download process** for xDR (CDR) files.

    * Useful for **troubleshooting** and ensuring data integrity.'
- name: integration.equipment
  x-displayName: Equipment
  description: 'This package allows you to manage integrations with external equipment
    for

    downloading and processing xDR (CDR) files, as well as for RADIUS AAA

    (Authentication, Authorization, and Accounting) and SIP-based authorization

    and routing.


    ### Key features


    * Integrate with **external equipment** for xDR file processing.

    * Support for **RADIUS AAA** for robust authentication and authorization.

    * Manage **SIP-based authorization and routing** configurations.'
- name: system.events
  x-displayName: Events log
  description: 'The package provides access to system-generated events for monitoring

    and health observation.


    ### Key features


    * Logs **system events** from various system services.

    * Helps **track, diagnose, and analyze** system activity.

    * Supports **troubleshooting** and operational visibility.'
- name: system.events.tags
  x-displayName: Events log / Tags
  description: 'The package provides information about available tags for filtering
    and

    retrieving system events.'
- name: system.events.config
  x-displayName: Events log / Watch rules
  description: 'The package allows managing automated monitoring rules for system
    events.


    ### Key features


    * Defines **filters** based on service, severity, and content.

    * Enables **email notifications** for specific system events.


    :::note


    The rules are processed by the *"Events Manager"* system service.


    :::'
- name: rates.exports.templates
  x-displayName: Export / Templates
  description: 'Export templates streamline the process of exporting rate data with

    customizable formats and settings.


    ### Key features


    * **Manage export templates** for rate data.

    * **Customize file formats, columns, and delimiters** for export.

    * **Define date formats** and other settings for tailored exports.'
- name: custom_fields
  x-displayName: Fields definitions
  description: 'The package allows management of the list of available custom fields
    for

    corresponding entities (currently clients, packages, and dids).


    ### Partition-based customization


    Custom fields are defined at the Partition level (`companies_id`), allowing

    each partition to maintain a unique set of custom fields.'
- name: system.files
  x-displayName: File management
  description: 'The package provides access to uploaded files and metadata.


    ### Key features


    * Lists **stored files** in the system.

    * Retrieves **metadata** and details for tracking file usage.'
- name: lnp.gateways
  x-displayName: Gateways
  description: 'The package provides access to the list and configuration of the **external

    LNP/MNP gateways** supported by the system.


    :::tip Number portability processing


    The number portability processing is configured within the *"Events

    processing & control / Traffic rules"* section.


    :::


    :::info Internal number portability database


    The internal number portability database is managed within the *"Ranges"*

    section.


    :::'
- name: system
  x-displayName: General
  description: 'The package provides functionality for retrieving general reference
    data used

    across the system. It allows access to common reference information that

    supports consistency and standardization throughout the platform.'
- name: rates.generators
  x-displayName: Generators
  description: 'Generators allow you to automate the creation of customer rates based
    on

    vendor offerings, considering quality and margin requirements.


    ### Key features


    * **Define rules** for rate generation based on vendor offerings.

    * **Incorporate vendor route quality, margins, and priorities** into rate creation.

    * **Automate customer rate generation** to streamline operations.'
- name: rates.generators.queue
  x-displayName: Generators / Queue
  description: 'The queue system triggers the generation of rates using

    pre-configured generators, ensuring timely updates.


    ### Key features


    * **Trigger rate generation** based on selected generators.

    * **Manage and monitor** queued rate generation tasks.


    :::note


    The queue system itself is handled by the *"Rates Generators"* system service.


    :::'
- name: rates.imports
  x-displayName: Import
  description: 'Import functionalities facilitate the upload and management of rate
    files,

    ensuring seamless integration into the system.


    ### Key features


    * **Enqueue rate files** for import and monitor their status.

    * **Use import templates** or custom settings for flexible importing.

    * **Track and manage** the import process efficiently.


    :::note


    The import process itself is handled by the *"Rates Import"* system service.


    :::'
- name: rates.imports.templates
  x-displayName: Import / Templates
  description: "Import templates simplify the rate import process with predefined\
    \ structures\nand settings.\n\n### Key features\n\n* **Manage import templates**\
    \ for manual or automated rate imports.\n* **Define format details** such as column\
    \ order, default values,\n  effective dates, etc.\n* Use to streamline import\
    \ of **vendor rate notifications**."
- name: accounting.invoices
  x-displayName: Invoices
  description: 'The package allows you to manage invoices, as well as retrieve detailed

    information on system-generated invoices for further processing, such as

    exporting to dedicated accounting systems. It also enables uploading

    incoming invoices to track vendor account balances.


    ### Key features


    * Retrieve and manage **invoices generated** by the system.

    * Export invoice data for integration with **external accounting systems**.

    * Upload incoming vendor invoices to maintain **accurate financial records**.'
- name: companies.legal_entities
  x-displayName: Legal entities
  description: 'Legal entities allow you to manage billing and operational settings
    for

    separate legal entities within the same system, enabling multi-market

    business operations.


    ### Key features


    * Manage **settings and parameters** specific to each legal entity.

    * Enables **multi-market operations** under a unified billing system.

    * Ensures compliance with **local regulations** for each entity.'
- name: companies.legal_entities.payment_systems_configurations
  x-displayName: Legal entities / Payment system configurations
  description: "This package allows you to configure payment gateways (e.g., Authorize.net,\n\
    USAePay) for each legal entity.\n\n### Key features\n\n* Manage **credentials\
    \ and settings** for supported payment gateways.\n* Configure **entity-specific**\
    \ payment processing methods.\n* Supports **seamless integration** with **external\
    \ payment systems** for each\n  legal entity."
- name: system.license_info
  x-displayName: License info
  description: 'The package provides information about the system license.


    ### Key features


    * Displays **license status** and validity.

    * Provides **terms and limitations** for system usage.'
- name: configuration.low_balance_profiles
  x-displayName: Low balance profiles
  description: "The package allows you to configure rules for alerting both customers\
    \ and\nmanagers about low balances. These rules are grouped into \"profiles\"\
    \ for\neasy assignment to multiple customer groups.\n\n### Key features\n\n* Create\
    \ and manage low balance alert profiles.\n* Assign profiles to groups of customers\
    \ for consistent alerting.\n* Customize alert thresholds and notification methods.\n\
    \n### Rule models\n\nDepending on the origin of the monitoring the rule will fire\
    \ if:\n\n* `orig` - client balance has fallen below threshold value (typically\
    \ used for\n  customers)\n* `term` - client balance has raised above threshold\
    \ value (typically used for\n  resellers)\n\n:::note\n\nThe profiles are processed\
    \ by the *\"Low Balance Profiles\"* system service.\n\n:::"
- name: system.notifications
  x-displayName: Notifications
  description: 'The package provides access to system alerts and status updates.


    ### Key features


    * Displays **license alerts**, **overload warnings**, and **system status**.

    * Helps monitor **critical events** in real time.'
- name: dids.operators
  x-displayName: Operators
  description: 'The Operators package is used for logically grouping DIDs based on
    the

    **operators** that provide them, ensuring proper organization and tracking.'
- name: reports.origterm
  x-displayName: Orig-Term report
  description: 'Orig-Term report provides pre-aggregated data connecting customer-to-vendor

    events (e.g., calls, messages) and get insights on the traffic flow, quality,

    and profitability.


    ### Key features


    * Pre-aggregated insights on the **customer-to-vendor traffic flow**.

    * Analyze **performance, quality, and profitability.**

    * **Extensive filtering, grouping, and slicing** of post-aggregated data.


    :::note


    Data for the Orig-Term report is prepared incrementally by the *"Orig-Term

    Report Generator"* system service.


    :::'
- name: packages
  x-displayName: Packages
  description: "Packages are pre-configured products or plans that customers can subscribe\
    \ to.\nThis API allows you to manage the list of packages you offer, including\
    \ all\nthe entitlements they provide.\n\n### Key features\n\n* **Manage package\
    \ configurations**, including billing periods, renewal\n  policies, rating mechanisms\
    \ and entitlements.\n* Support for **pro-rating and discount policies**, ensuring\
    \ flexible pricing\n  options.\n* **Entitlements include**:\n  * Volume buckets\
    \ for services (e.g., 1000 minutes to Canada).\n  * Credits for specific services\
    \ or service groups (e.g., $50 for video\n    conferences).\n  * DIDs by tier\
    \ (e.g., silver, gold).\n\n:::tip Lifecycle management\n\nFor more details on\
    \ managing package lifecycle and assigning them to clients,\nrefer to the *\"\
    Client Management / Subscriptions\"* section.\n\n:::"
- name: companies
  x-displayName: Partitions (resellers)
  description: "Partitions (also referred to as resellers) provide a mechanism to\
    \ manage\nmultiple **isolated** or **semi-isolated** environments within JeraSoft\n\
    Billing.\n\n### Key features\n\n* **Root-level partitions** create completely\
    \ isolated environments, allowing\n  for separate client sets, rate tables, and\
    \ routing.\n* **Nested-level entities** enable the creation of resellers and sub-reseller\n\
    \  hierarchies for complex distribution models.\n* Facilitates management of different\
    \ business units or partners within a single\n  platform."
- name: accounting.payment_accounts
  x-displayName: Payment accounts
  description: 'Payment accounts allow you to group various transactions into separate

    accounts for streamlined reporting. This feature is useful for categorizing

    transactions by various criteria, such as payment methods, payment gateways,

    or other attributes.


    ### Key features


    * Define payment accounts to **group transactions** by various criteria.

    * Facilitate **detailed reporting** based on payment methods.

    * Enhance **financial tracking** by segregating payments from different sources.'
- name: clients.payment_systems_profiles
  x-displayName: Payment system profiles
  description: "Payment system profiles store client payment details within external\n\
    payment processors (e.g., Authorize.net, USAePay) for automated billing.\n\n###\
    \ Key features\n\n* Used for **asynchronous charging** of client accounts.\n*\
    \ Enables **auto-charging** when configured.\n* Typically managed via the Client\
    \ Portal (either JeraSoft's built-in\n  portal or an external custom integration)."
- name: integration.payment_systems
  x-displayName: Payment systems
  description: 'The package provides access to supported external payment gateways
    that can

    be used to charge your customers.


    :::tip


    To manage configurations and keys, refer to the *"Partitions & Legal

    Entities / Payment System Configurations"* section.


    :::'
- name: accounting.payment_terms
  x-displayName: Payment terms
  description: 'Payment terms define the billing agreements you have with customers
    or vendors,

    including billing cycles, due dates, and notification intervals for unpaid

    invoices. You can customize payment terms for each client to automate invoicing

    and track financial agreements.


    ### Key features


    * Define custom **billing cycles** (e.g., monthly with a 7-day due time).

    * Set **notification intervals** for unpaid invoices.'
- name: routing.plans
  x-displayName: Plans
  description: "Routing plans define the overall routing strategy for clients or specific\n\
    client accounts. A routing plan establishes key parameters that determine\nhow\
    \ traffic should be routed, while specific **routing rules** define the\nper-destination\
    \ routing logic.\n\n### Key features\n\n* Routing plans can be assigned at the\
    \ **client** or **account** level.\n* The actual **routing map is updated periodically**\
    \ by the \"Dynamic Routing\n  Manager\" system service, which takes into account\
    \ vendor availability,\n  statistics, and rates.\n\n:::tip\n\nTo manage routing\
    \ rules within a plan, please refer to the *\"Routing Rules\"*\nsection.\n:::"
- name: routing.plans.rules
  x-displayName: Plans / Rules
  description: "Routing rules define the conditions and actions that govern how traffic\
    \ is\nrouted within a routing plan. Each rule specifies criteria such as destination,\n\
    allowed vendors, rate conditions, and quality parameters, ensuring flexible\n\
    control over traffic distribution.\n\n### Key features\n\n* Used to define **dynamic\
    \ and static** routes.\n* Allow to define routes based on **various conditions**\
    \ such as destination,\n  profitability, quality, and other parameters."
- name: routing.policies
  x-displayName: Policies
  description: "Routing policies define balancing strategies for routing rules with\
    \ a *dynamic*\ntype. These policies ensure optimal routing by adjusting decisions\
    \ based on\nreal-time conditions.\n\n### Key features\n\n* Policies control how\
    \ **various factors** (rate, quality, financial) influence\n  routing.\n* Dynamic\
    \ routing decisions consider **real-time** vendor performance, costs,\n  and constraints."
- name: configuration.quantities
  x-displayName: Quantities
  description: 'Quantities are entities used within the "Services" definition to specify
    how

    services are billed. Examples include "time" (for calls), "event" (for

    messages), and "data" (for internet traffic). This package provides read-only

    access to the quantities the system processes.'
- name: lnp.ranges
  x-displayName: Ranges
  description: 'The package provides tools to manage the **internal number portability

    database**.


    :::tip Number portability processing


    The number portability processing is configured within the *"Events

    processing & control / Traffic rules"* section.


    :::


    :::info External number portability databases


    The external number portability databases are managed within the *"Gateways"*

    section.


    :::'
- name: rates.tables
  x-displayName: Rate tables
  description: 'Rate tables group rates together for easy management and application
    to

    customers and vendors.


    ### Key features


    * **Group rates** into rate tables for both customers and vendors.

    * **Associate rate tables** with specific services (e.g., calls, messages).

    * **Assign multiple rate tables** to customers for different services.


    :::tip


    In order to manage individual rates within a table, please refer to the

    *Rates* section.


    :::'
- name: rates
  x-displayName: Rates
  description: 'Rates management enables detailed control over rates and their parameters.


    ### Key features


    * **Manage rates within rate tables**, including all parameters.

    * **Create blocked rates** to control specific sub-destinations.

    * **Perform bulk updates** using specific filters.'
- name: aaa.rerating
  x-displayName: Rerating
  description: 'The package enables management of the rerating of previously rated
    events.

    This is necessary when rates have been corrected or events were misassigned.

    Rerating is processed asynchronously, with events queued and handled in the

    background.


    ### Key features


    * Allows **submission of events for rerating** when rates or assignments change.

    * Processes rerating **asynchronously** via a background queue.

    * Provides tools to **monitor the progress** of rerating tasks.


    :::note


    The rerating is processed by the *"Rerating"* system service.


    :::'
- name: iam.roles
  x-displayName: Roles
  description: 'The package enables the management of user roles, which define sets
    of

    permissions that can be assigned to users.


    ### Key features


    * Combines multiple **permissions** into a single role.

    * Ensures **access control** by assigning roles to users.'
- name: system.services
  x-displayName: Services
  description: 'The package allows managing system services and their execution schedules.


    ### Key features


    * Configures **execution schedules** for system tasks.

    * Allows **manual service execution** when needed.'
- name: configuration.services
  x-displayName: Services
  description: 'The package allows you to define the types of services provided and
    billed,

    such as for example calls, video conferences, and messages, etc. Each service

    includes the quantity it is billed in (e.g., "time" for calls) and units for

    rate definitions and reporting.


    ### Key features


    * Define and manage various **service types**.

    * Assign **billing quantities** and **reporting units**.

    * Customize **rates and reporting formats** for each service.'
- name: system.services.active
  x-displayName: Services / Active
  description: 'The package provides real-time information about currently running
    services.


    ### Key features


    * Lists **active services** and their statuses.

    * Supports **reloading** or **terminating** services.'
- name: system.settings
  x-displayName: Settings
  description: 'The package allows managing global system-wide settings.


    ### Key features


    * Controls **system-wide configuration** options.

    * Ensures **consistent behavior** across the platform.'
- name: rates.special
  x-displayName: Special rates
  description: 'Special rates override generated rates, providing flexibility in rate

    management based on code names.


    ### Key features


    * **Manage special rates** to override standard rate generation.

    * **Define rates by code name** instead of numeric codes.

    * **Automatically extend rates** to include relevant sub-codes.


    :::note


    Special rates are mostly used in conjunction with rate generators.


    :::'
- name: system.statistics
  x-displayName: Statistic packages
  description: 'The package provides insights into system usage and license consumption.


    ### Key features


    * Reports **daily and monthly usage** statistics.

    * Helps **monitor license limits consumption**.'
- name: reports.queries
  x-displayName: Stored queries
  description: 'Stored Queries allow managing reusable queries for all supported reports.


    ### Key features


    * **Streamline report generation** in the Web UI.

    * **Share report results** automatically via email.

    * **Execute regular monitoring** with stored queries.'
- name: reports.queries.monitoring
  x-displayName: Stored queries / Monitoring
  description: 'The package enables management of the scheduled monitoring rules based
    on

    the stored report queries. The use cases include **fraud detection, hacking

    prevention, routing alterations** and more.


    ### Key features


    * **Automatic traffic rule creation** based on the report queries results.

    * **Periodical or fixed-time** execution of the report queries.

    * **Client and manager notifications** for specific activities.


    :::note


    Rule execution is handled by the *"Reports Monitoring"* system service.


    :::'
- name: reports.queries.toemail
  x-displayName: Stored queries / To email
  description: 'The package enables management of the rules for automatic email delivery
    of

    the report results.


    ### Key features


    * **Periodical or fixed-time** execution of the report queries.

    * **Delivery of the report results** directly to the email addresses.


    :::note


    Rule execution is handled by the *"Reports To Email"* system service.


    :::'
- name: clients.subscriptions
  x-displayName: Subscriptions
  description: "Subscriptions represent assigned service packages for a client,\n\
    defining access to resources and applicable charges.\n\n### Key features\n\n*\
    \ Subscriptions **associate a package** with a client.\n* Influence **authorization\
    \ and rating**, determining service access\n  and applicable fees.\n* May include\
    \ **pre-allocated limits** affecting billing calculations.\n\n### Lifecycle\n\n\
    * Lifecycle is managed by the \"Packages Manager\" system service.\n* Activated\
    \ upon assignment (except for those scheduled to be activated\n  at a later date)."
- name: clients.subscriptions.periods
  x-displayName: Subscriptions / Periods
  description: 'Subscription periods provide detailed insights into usage within

    a specific billing cycle.


    ### Key features


    * Defines the **allocated limits and usage tracking** for the given time frame.

    * Used for **billing calculations** and service enforcement.

    * Allows tracking historical data per subscription instance.'
- name: reports.summary
  x-displayName: Summary report
  description: 'Summary report provides access to the pre-aggregated data based on

    the billed xDRs (CDRs).


    ### Key features


    * **High-level insights** into billing data with flexible grouping.

    * **Rapid aggregation** of millions of xDRs for quick analysis.

    * **Extensive filtering, grouping, and slicing** of post-aggregated data.


    :::note


    Data is prepared by the *"Summary"* system service.


    :::'
- name: swap_deals
  x-displayName: Swap deals
  description: 'The package provides functionality for managing swap deals within
    the system.


    To manage items within swap deals, refer to the "Swap Deals / Items" package,

    which offers specific functionality for handling the individual items involved.'
- name: swap_deals.items
  x-displayName: Swap deals / Items
  description: 'The package provides functionality for managing the individual items
    within

    swap deals.'
- name: configuration.tags
  x-displayName: Tags
  description: 'The package allows you to list and manage all tags used within the
    system. Tags

    help in categorizing and organizing data for various processes.


    ### Key features


    * Create and manage system-wide tags.

    * Use tags for categorization and data organization.'
- name: accounting.taxes
  x-displayName: Taxes
  description: "This package allows you to manage taxes within tax profiles, including\
    \ defining\ntax rates and effective dates to track historical changes. You can\
    \ configure\ntaxes to be applied simultaneously or sequentially.\n\n### Key features\n\
    \n* Manage and define taxes with effective dates for **historical tracking**.\n\
    * Apply taxes either **simultaneously or sequentially** (e.g., applying VAT and\n\
    \  environmental tax together, or applying local tax after federal tax).\n* Integrate\
    \ taxes into invoices and financial reports."
- name: accounting.taxes.profiles
  x-displayName: Taxes / Profiles
  description: "Tax profiles allow you to group sets of taxes applicable to different\
    \ customer\nsegments. Profiles can be managed internally or linked to external\
    \ systems for\ntax calculations, particularly useful for US-based providers.\n\
    \n### Key features\n\n* **Group multiple taxes** into profiles for easy management.\n\
    * Create **internal profiles** with in-system managed taxes or **external profiles**\n\
    \  relying on third-party tax calculations.\n* Assign tax profiles to specific\
    \ customers based on their location or business\n  type.\n\n:::tip\n\nTo define\
    \ tax rates within a profile, refer to the *\"Taxes\"* package.\n\n:::"
- name: configuration.time_profiles
  x-displayName: Time profiles
  description: 'The package allows you to define time intervals, such as business
    hours or

    weekends, which can be used to set time-dependent rates or adjust dynamic

    routing conditions.


    ### Key features


    * Create and manage time intervals.

    * Apply time profiles to rates and dynamic routing.

    * Customize profiles for business-specific time conditions.'
- name: accounting.topup
  x-displayName: Top-up cards
  description: 'The package allows you to generate and manage series of top-up cards,
    which can

    be redeemed via API or through the JeraSoft client portal as a payment method.


    ### Key features


    * **Issue and manage top-up cards** for customer account credits.

    * **Redeem cards** through API integration or the client portal.

    * Track top-up card **usage and balances**.'
- name: aaa.traffic_rules
  x-displayName: Traffic rules
  description: 'The package enables the management of traffic rules, offering flexible
    controls

    over event processing. Rules can block, modify, or tag events based on specific

    criteria, tailoring the handling of different traffic types.


    ### Key features


    * Allows **blocking of events** based on defined attributes.

    * Supports **tagging and rewriting** of event parameters.

    * Provides flexible mechanisms to **control traffic flow and behavior**.'
- name: accounting.transactions
  x-displayName: Transactions
  description: 'Transactions refer to both charges and payments within the system.
    Charges

    reflect the costs billed to customers for services (on-demand events,

    subscription fee, etc), while payments record the actual money transfers

    from customers or to vendors.


    ### Key features


    * **Track all charges** for services and subscription fees.

    * **Record payments received** from customers and payments made to vendors.'
- name: configuration.units
  x-displayName: Units
  description: 'The package provides read-only access to units applicable to each
    quantity for

    defining rates, generating reports, and other system processes.'
- name: iam.users
  x-displayName: Users
  description: 'The package allows managing system users, defining their access and
    permissions.


    ### Key features


    * Assigns **roles** that determine user permissions.

    * Associates users with **partitions** to control data access.

    * Provides access to **API keys** for authentication and API usage.'
- name: integration.hooks
  x-displayName: Webhooks
  description: 'Webhooks allow you to notify external systems about important events
    in

    JeraSoft Billing, such as client creation, modification, or DID assignments.

    Webhooks send HTTP POST requests to specified URLs with event details.


    ### Key features


    * Notify external systems of **important billing events**.

    * Configure **HTTP POST** URLs to receive event data.

    * Include detailed **payloads** with event-specific information.


    :::note


    The webhooks are executed by the *"Provisioning Manager"* system service.


    :::'
- name: integration.hooks.events
  x-displayName: Webhooks / Events
  description: 'The package provides access to the full list of events that can trigger

    webhooks. Use this as a reference to configure your webhooks accurately.


    ### Key features


    * Access a **comprehensive list** of webhook-triggering events.

    * Reference event types to **customize webhook configurations**.'
- name: integration.hooks.logs
  x-displayName: Webhooks / Logs
  description: 'The package provides access to logs of all webhook calls and their
    results.

    This is essential for monitoring webhook activity and debugging integration

    issues.


    ### Key features


    * View logs of **all webhook calls**.

    * Analyze **call results** for successful and failed attempts.

    * Useful for **debugging** and ensuring webhook reliability.'
- name: aaa.xdrs
  x-displayName: xDR processing
  description: 'The package facilitates the upload of xDRs (event detail records)
    into the

    system via API. This serves as an alternative to integrating with external

    equipment using RADIUS accounting or file uploads.


    ### Key features


    * Enables **API-based upload** of xDR/CDR data.

    * Useful for **custom equipment** without RADIUS or CDR file support.

    * Provides an alternative to traditional file-based or RADIUS accounting methods.'
- name: reports.xdrs_list
  x-displayName: xDRs list
  description: "xDRs list allows querying billed xDRs at the most granular level.\n\
    \n### Key features\n\n* **Detailed CDR data** enriched with customer, account,\
    \ subscription,\n  and rate details.\n* **Direct querying** or immediate export\
    \ of data.\n* **Comprehensive information** from external equipment and internal\n\
    \  enrichment."
x-tagGroups:
- name: Client management
  tags:
  - clients.accounts
  - clients.notes
  - clients.templates
  - clients
  - clients.custom_fields
  - clients.payment_systems_profiles
  - clients.subscriptions
  - clients.subscriptions.periods
- name: Custom fields management
  tags:
  - custom_fields
- name: DID management
  tags:
  - dids.custom_fields
  - dids
  - dids.operators
- name: Dynamic routing
  tags:
  - routing.analysis
  - routing.plans
  - routing.plans.rules
  - routing.policies
- name: Event processing & control
  tags:
  - aaa.sessions
  - aaa
  - aaa.rerating
  - aaa.traffic_rules
  - aaa.xdrs
- name: Financial management
  tags:
  - accounting.currencies
  - accounting.currencies.rates
  - accounting.invoices
  - accounting.payment_accounts
  - accounting.payment_terms
  - accounting.taxes
  - accounting.taxes.profiles
  - accounting.topup
  - accounting.transactions
- name: General configuration
  tags:
  - configuration.codes
  - configuration.codes.decks
  - configuration.low_balance_profiles
  - configuration.quantities
  - configuration.services
  - configuration.tags
  - configuration.time_profiles
  - configuration.units
- name: Integrations
  tags:
  - integration.credentials
  - integration.download_logs
  - integration.equipment
  - integration.payment_systems
  - integration.hooks
  - integration.hooks.events
  - integration.hooks.logs
- name: Number portability
  tags:
  - lnp.gateways
  - lnp.ranges
- name: Packages management
  tags:
  - packages.custom_fields
  - packages
- name: Partitions & legal entities
  tags:
  - companies.legal_entities
  - companies.legal_entities.payment_systems_configurations
  - companies
- name: Rate management
  tags:
  - rates.agreements
  - rates.analysis
  - rates.exports.templates
  - rates.generators
  - rates.generators.queue
  - rates.imports
  - rates.imports.templates
  - rates.tables
  - rates
  - rates.special
- name: Reports & statistics
  tags:
  - reports.active_sessions
  - reports.origterm
  - reports.queries
  - reports.queries.monitoring
  - reports.queries.toemail
  - reports.summary
  - reports.xdrs_list
- name: Swap deal management
  tags:
  - swap_deals
  - swap_deals.items
- name: System administration
  tags:
  - system.audit_log
  - system.nodes
  - system.collectors
  - system.database
  - system.events
  - system.events.tags
  - system.events.config
  - system.files
  - system
  - system.license_info
  - system.notifications
  - system.services
  - system.services.active
  - system.settings
  - system.statistics
- name: User & access management
  tags:
  - iam.auth.jwt
  - iam
  - iam.profile
  - iam.roles
  - iam.users
paths:
  /aaa/authenticate:
    post:
      tags:
      - aaa
      operationId: aaa.authenticate
      summary: Authenticate client
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Authentication result.
          content:
            application/json:
              schema:
                type: object
                properties:
                  xdr:
                    type: object
                    properties:
                      id:
                        type: string
                        description: xDR internal system ID.
                      services_code:
                        type: string
                        description: 'Service identification code. As defined in the
                          `code` of

                          the service being used by the current event. Used for identification

                          of the service.'
                      collectors_id:
                        type: string
                        description: 'Collector ID used to process the xDR. Applicable
                          only to

                          non-API calls.'
                      equipment_id:
                        type: integer
                        description: Equipment ID that handles the current event.
                      leg_id:
                        type: string
                        description: 'Leg ID. Unique identifier generated by the equipment.
                          Must be

                          unique among all event legs (origination or terminations
                          parts of

                          the session) from the same equipment.'
                      session_id:
                        type: string
                        description: 'Session ID. Unique identifier of the session.
                          Must be the

                          same for both origination and termination legs of the event.'
                      units_id:
                        type: string
                        description: Units ID of the event.
                      unique_id:
                        type: string
                        description: 'Unique record ID. It is used to prevent duplicates
                          for the

                          equipment that fails to generate unique leg IDs and should
                          be

                          generated in addition to the leg ID. If the equipment generates

                          unique leg IDs, this field can be equal to the leg ID.'
                      origin:
                        type: string
                        description: Event origin.
                      volume:
                        type: number
                        description: Event volume given in units defined by `units_id`.
                      subscriber_host:
                        type: string
                        description: 'Subscriber IP address. It will be matched against

                          accounts defined with `ip` identification method.'
                      subscriber_id:
                        type: string
                        description: 'Subscriber name, will be matched against accounts

                          defined with `name` identification method.'
                      src_party_id:
                        type: string
                        description: 'Source party ID (number). Will be used for billing
                          if

                          `rate_<origin>_party_id` flag on the respective equipment
                          is `True`.'
                      src_party_id_bill:
                        type: string
                        description: 'Source party billing ID (number). Will be used
                          for

                          billing if `rate_<origin>_party_id` flag on the respective

                          equipment is `False`.'
                      dst_party_id:
                        type: string
                        description: 'Destination party ID (number). Will be used
                          for billing

                          if `rate_<origin>_party_id` flag on the respective equipment
                          is

                          `True`.'
                      dst_party_id_bill:
                        type: string
                        description: 'Destination party billing ID (number). Will
                          be used

                          for billing if `rate_<origin>_party_id` flag on the respective

                          equipment is `False`.'
                      setup_time:
                        type: string
                        description: Event setup timestamp.
                      start_time:
                        type: string
                        description: 'Event start timestamp. For events that last
                          over time,

                          this field represents the start of the activity (e.g. for
                          calls,

                          this is the time when the call was connected).'
                      stop_time:
                        type: string
                        description: 'Event finish timestamp. For events that last
                          over time,

                          this field represents the end of the activity (e.g. for
                          calls,

                          this is the time when the call was disconnected).'
                      result_code:
                        type: string
                        description: Result code normalized to Q.931 standard.
                      result_status:
                        type: string
                        description: Result status. Represents category of the result
                          code.
                      pdd:
                        type: number
                        description: Post dial delay given in units defined by `units_id`.
                      scd:
                        type: number
                        description: Session connect delay given in units defined
                          by `units_id`.
                      switch_code:
                        type: string
                        description: 'Result code from the equipment (before normalization

                          to Q.931 standard if the equipment uses different codes).'
                      custom:
                        type: object
                        description: Additional xDR parameters. Not processed, for
                          display only.
                      extra:
                        type: object
                        description: xDR extra parameters, for internal usage only.
                    required: []
                  tp_result:
                    type: object
                    properties:
                      id:
                        type: integer
                        description: ID of the last executed traffic processing rule
                      deny:
                        type: boolean
                        description: Event denied by traffic processing rule
                      services_id:
                        type: integer
                        description: Service ID after traffic processing
                      src_party_id:
                        type: string
                        description: Src Party ID after traffic processing
                      dst_party_id:
                        type: string
                        description: Dst Party ID after traffic processing
                      tags:
                        type: array
                        description: Tags added by traffic processing
                      state:
                        type: object
                        description: Internal traffic processing state
                    required: []
                  processed_rules:
                    type: object
                  service:
                    type: object
                  equipment:
                    type: object
                  account:
                    type: object
                  client:
                    type: object
                  legal_entity:
                    type: object
                  company:
                    type: object
                  regular_rate_tables_ids:
                    type: array
                  additive_rate_tables_ids:
                    type: array
                  rate_table:
                    type: object
                  rate:
                    type: object
                  tax:
                    type: array
                  clients_packages_limit:
                    type: object
                  packages_quotas:
                    type: object
                  routing_rules_id:
                    type: integer
                  volume:
                    type: number
                    description: Client's available volume
                  billed_company:
                    type: object
                    description: Billed Company
                  did_owner:
                    type: object
                    description: Owner of the DID
                  routes:
                    type: array
                    items:
                      type: object
                    description: List of available routes
                  capacity:
                    type: array
                    items:
                      type: object
                  reseller_rate:
                    type: object
                required: []
      description: ':::note[JSON-RPC]

        aaa.authenticate

        :::


        The method is used to authenticate the client according to the accounts

        defined in the system. The typical use case is to authenticate the client

        on an attempt to register on the equipment.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                xdr:
                  type: object
                  properties:
                    equipment_id:
                      type: integer
                      description: Equipment ID that handles the current event.
                    services_code:
                      type: string
                      maxLength: 255
                      description: Service identification code. As defined in the
                        `code` of the service being used by the current event. Used
                        for identification of the service.
                    subscriber_host:
                      type:
                      - string
                      - 'null'
                      format: cidr
                      description: Subscriber IP address. It will be matched against
                        accounts defined with `ip` identification method.
                      default: null
                    subscriber_id:
                      type:
                      - string
                      - 'null'
                      maxLength: 255
                      description: Subscriber name, will be matched against accounts
                        defined with `name` identification method.
                      default: null
                    src_party_id:
                      type:
                      - string
                      - 'null'
                      maxLength: 255
                      description: Source party ID (number). Will be used for billing
                        if `rate_<origin>_party_id` flag on the respective equipment
                        is `True`.
                      default: null
                    src_party_id_bill:
                      type:
                      - string
                      - 'null'
                      maxLength: 255
                      description: Source party billing ID (number). Will be used
                        for billing if `rate_<origin>_party_id` flag on the respective
                        equipment is `False`.
                      default: null
                    dst_party_id:
                      type:
                      - string
                      - 'null'
                      maxLength: 255
                      description: Destination party ID (number). Will be used for
                        billing if `rate_<origin>_party_id` flag on the respective
                        equipment is `True`.
                      default: null
                    dst_party_id_bill:
                      type:
                      - string
                      - 'null'
                      maxLength: 255
                      description: Destination party billing ID (number). Will be
                        used for billing if `rate_<origin>_party_id` flag on the respective
                        equipment is `False`.
                      default: null
                    setup_time:
                      type:
                      - string
                      - 'null'
                      format: date-time
                      description: Event setup timestamp.
                      default: now()
                  required:
                  - equipment_id
                  - services_code
                  dependentRequired: {}
                  description: xDR object.
                password:
                  type:
                  - string
                  - 'null'
                  maxLength: 256
                  default: null
                  description: 'Password in plain text. Used only if account is configured

                    with `name` identification method and password is set.'
              required:
              - xdr
              dependentRequired: {}
  /aaa/authorize:
    post:
      tags:
      - aaa
      operationId: aaa.authorize
      summary: Authorize event
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Authentication result.
          content:
            application/json:
              schema:
                type: object
                properties:
                  xdr:
                    type: object
                    properties:
                      id:
                        type: string
                        description: xDR internal system ID.
                      services_code:
                        type: string
                        description: 'Service identification code. As defined in the
                          `code` of

                          the service being used by the current event. Used for identification

                          of the service.'
                      collectors_id:
                        type: string
                        description: 'Collector ID used to process the xDR. Applicable
                          only to

                          non-API calls.'
                      equipment_id:
                        type: integer
                        description: Equipment ID that handles the current event.
                      leg_id:
                        type: string
                        description: 'Leg ID. Unique identifier generated by the equipment.
                          Must be

                          unique among all event legs (origination or terminations
                          parts of

                          the session) from the same equipment.'
                      session_id:
                        type: string
                        description: 'Session ID. Unique identifier of the session.
                          Must be the

                          same for both origination and termination legs of the event.'
                      units_id:
                        type: string
                        description: Units ID of the event.
                      unique_id:
                        type: string
                        description: 'Unique record ID. It is used to prevent duplicates
                          for the

                          equipment that fails to generate unique leg IDs and should
                          be

                          generated in addition to the leg ID. If the equipment generates

                          unique leg IDs, this field can be equal to the leg ID.'
                      origin:
                        type: string
                        description: Event origin.
                      volume:
                        type: number
                        description: Event volume given in units defined by `units_id`.
                      subscriber_host:
                        type: string
                        description: 'Subscriber IP address. It will be matched against

                          accounts defined with `ip` identification method.'
                      subscriber_id:
                        type: string
                        description: 'Subscriber name, will be matched against accounts

                          defined with `name` identification method.'
                      src_party_id:
                        type: string
                        description: 'Source party ID (number). Will be used for billing
                          if

                          `rate_<origin>_party_id` flag on the respective equipment
                          is `True`.'
                      src_party_id_bill:
                        type: string
                        description: 'Source party billing ID (number). Will be used
                          for

                          billing if `rate_<origin>_party_id` flag on the respective

                          equipment is `False`.'
                      dst_party_id:
                        type: string
                        description: 'Destination party ID (number). Will be used
                          for billing

                          if `rate_<origin>_party_id` flag on the respective equipment
                          is

                          `True`.'
                      dst_party_id_bill:
                        type: string
                        description: 'Destination party billing ID (number). Will
                          be used

                          for billing if `rate_<origin>_party_id` flag on the respective

                          equipment is `False`.'
                      setup_time:
                        type: string
                        description: Event setup timestamp.
                      start_time:
                        type: string
                        description: 'Event start timestamp. For events that last
                          over time,

                          this field represents the start of the activity (e.g. for
                          calls,

                          this is the time when the call was connected).'
                      stop_time:
                        type: string
                        description: 'Event finish timestamp. For events that last
                          over time,

                          this field represents the end of the activity (e.g. for
                          calls,

                          this is the time when the call was disconnected).'
                      result_code:
                        type: string
                        description: Result code normalized to Q.931 standard.
                      result_status:
                        type: string
                        description: Result status. Represents category of the result
                          code.
                      pdd:
                        type: number
                        description: Post dial delay given in units defined by `units_id`.
                      scd:
                        type: number
                        description: Session connect delay given in units defined
                          by `units_id`.
                      switch_code:
                        type: string
                        description: 'Result code from the equipment (before normalization

                          to Q.931 standard if the equipment uses different codes).'
                      custom:
                        type: object
                        description: Additional xDR parameters. Not processed, for
                          display only.
                      extra:
                        type: object
                        description: xDR extra parameters, for internal usage only.
                    required: []
                  tp_result:
                    type: object
                    properties:
                      id:
                        type: integer
                        description: ID of the last executed traffic processing rule
                      deny:
                        type: boolean
                        description: Event denied by traffic processing rule
                      services_id:
                        type: integer
                        description: Service ID after traffic processing
                      src_party_id:
                        type: string
                        description: Src Party ID after traffic processing
                      dst_party_id:
                        type: string
                        description: Dst Party ID after traffic processing
                      tags:
                        type: array
                        description: Tags added by traffic processing
                      state:
                        type: object
                        description: Internal traffic processing state
                    required: []
                  processed_rules:
                    type: object
                  service:
                    type: object
                  equipment:
                    type: object
                  account:
                    type: object
                  client:
                    type: object
                  legal_entity:
                    type: object
                  company:
                    type: object
                  regular_rate_tables_ids:
                    type: array
                  additive_rate_tables_ids:
                    type: array
                  rate_table:
                    type: object
                  rate:
                    type: object
                  tax:
                    type: array
                  clients_packages_limit:
                    type: object
                  packages_quotas:
                    type: object
                  routing_rules_id:
                    type: integer
                  volume:
                    type: number
                    description: Client's available volume
                  billed_company:
                    type: object
                    description: Billed Company
                  did_owner:
                    type: object
                    description: Owner of the DID
                  routes:
                    type: array
                    items:
                      type: object
                    description: List of available routes
                  capacity:
                    type: array
                    items:
                      type: object
                  reseller_rate:
                    type: object
                required: []
      description: ':::note[JSON-RPC]

        aaa.authorize

        :::


        The method is used to authorize the event according to the accounts

        and rates defined in the system.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                xdr:
                  type: object
                  properties:
                    equipment_id:
                      type: integer
                      description: Equipment ID that handles the current event.
                    services_code:
                      type: string
                      maxLength: 255
                      description: Service identification code. As defined in the
                        `code` of the service being used by the current event. Used
                        for identification of the service.
                    leg_id:
                      type: string
                      maxLength: 255
                      description: Leg ID. Unique identifier generated by the equipment.
                        Must be unique among all event legs (origination or terminations
                        parts of the session) from the same equipment.
                    session_id:
                      type: string
                      maxLength: 255
                      description: Session ID. Unique identifier of the session. Must
                        be the same for both origination and termination legs of the
                        event.
                    units_id:
                      type: string
                      description: Units ID of the event. It is used to get allowed
                        volume.
                    subscriber_host:
                      type:
                      - string
                      - 'null'
                      format: cidr
                      description: Subscriber IP address. It will be matched against
                        accounts defined with `ip` identification method.
                      default: null
                    subscriber_id:
                      type:
                      - string
                      - 'null'
                      maxLength: 255
                      description: Subscriber name, will be matched against accounts
                        defined with `name` identification method.
                      default: null
                    src_party_id:
                      type:
                      - string
                      - 'null'
                      maxLength: 255
                      description: Source party ID (number). Will be used for billing
                        if `rate_<origin>_party_id` flag on the respective equipment
                        is `True`.
                      default: null
                    src_party_id_bill:
                      type:
                      - string
                      - 'null'
                      maxLength: 255
                      description: Source party billing ID (number). Will be used
                        for billing if `rate_<origin>_party_id` flag on the respective
                        equipment is `False`.
                      default: null
                    dst_party_id:
                      type:
                      - string
                      - 'null'
                      maxLength: 255
                      description: Destination party ID (number). Will be used for
                        billing if `rate_<origin>_party_id` flag on the respective
                        equipment is `True`.
                      default: null
                    dst_party_id_bill:
                      type:
                      - string
                      - 'null'
                      maxLength: 255
                      description: Destination party billing ID (number). Will be
                        used for billing if `rate_<origin>_party_id` flag on the respective
                        equipment is `False`.
                      default: null
                    setup_time:
                      type:
                      - string
                      - 'null'
                      format: date-time
                      description: Event setup timestamp.
                      default: now()
                  required:
                  - equipment_id
                  - services_code
                  - leg_id
                  - session_id
                  - units_id
                  dependentRequired: {}
                  description: xDR object.
                check_capacity:
                  type: boolean
                  default: false
                  description: 'If `True`, the method will check capacity limits and

                    raise an error if exceeded.'
                routing_limit:
                  type: integer
                  minimum: 0
                  maximum: 9999
                  default: 0
                  description: 'Maximum number of routes to return, set 0 to disable

                    routing.'
              required:
              - xdr
              dependentRequired: {}
  /aaa/rerating:
    post:
      tags:
      - aaa.rerating
      operationId: aaa.rerating.create
      summary: Initiate rerating
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Rerating queue item object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        aaa.rerating.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                status:
                  type: string
                  enum:
                  - enqueue
                  - processing
                  - completed
                  description: 'Rerating status. Should be set to `enqueue`. Other
                    statuses

                    are reserved for internal use.'
                estimated_events:
                  type: integer
                  minimum: 1
                  description: 'Estimated number of events to be processed. The

                    value should be preliminarily estimated by pulling xDR records

                    according to the query.'
                query:
                  type: object
                  properties:
                    filters:
                      type: object
                      properties:
                        date:
                          type: array
                          minItems: 2
                          maxItems: 2
                          items:
                            type: string
                            format: date-time
                          example:
                          - '2025-06-10T10:00:00.000Z'
                          - '2025-07-02T16:00:00.000Z'
                          description: Date range.
                        id:
                          type: array
                          items:
                            type: integer
                          description: xDR leg ID.
                        origin:
                          type: string
                          enum:
                          - orig
                          - term
                          description: xDR leg origin.
                        equipment_id:
                          type: array
                          items:
                            type: integer
                          description: Equipment ID.
                        result_code:
                          type: array
                          items:
                            type: integer
                          description: xDR leg result code.
                        result_status:
                          type: array
                          items:
                            type: string
                            enum:
                            - success
                            - busy
                            - nochannel
                            - error
                          description: xDR leg result status. Determined by the result
                            code.
                        session_id:
                          type: array
                          items:
                            type: string
                          description: xDR session ID.
                        volume:
                          type: array
                          minItems: 2
                          maxItems: 2
                          items:
                            type: number
                            format: decimal
                          example:
                          - 0.1
                          - 10.1
                          description: Event volume (duration). Defined as a range.
                        volume_notzero:
                          type: boolean
                          description: If `True`, only events with non-zero volume
                            (duration) will be returned.
                        pdd:
                          type: array
                          minItems: 2
                          maxItems: 2
                          items:
                            type: number
                            format: decimal
                          example:
                          - 0.1
                          - 10.1
                          description: PDD range.
                        scd:
                          type: array
                          minItems: 2
                          maxItems: 2
                          items:
                            type: number
                            format: decimal
                          example:
                          - 0.1
                          - 10.1
                          description: SCD range.
                        status:
                          type: string
                          enum:
                          - processed
                          - in_rerating
                          - new
                          description: xDR processing status.
                        src_party_id_ext:
                          type: string
                          description: Source party ID.
                        dst_party_id_ext:
                          type: string
                          description: Destination party ID.
                        src_party_id_bill:
                          type: string
                          description: Source party ID pre-processed by equipment
                            for billing.
                        dst_party_id_bill:
                          type: string
                          description: Destination party ID pre-processed by equipment
                            for billing.
                        billed_services_id:
                          type: array
                          items:
                            type: integer
                          description: Service ID(s).
                        billed_companies_id:
                          type: array
                          items:
                            type: integer
                          description: Partition ID(s) of the client.
                        owner_users_id:
                          type: array
                          items:
                            type: integer
                          description: Owner user ID(s) of the client.
                        billed_owner_companies_id:
                          type: array
                          items:
                            type: integer
                          description: Partition ID(s) of the owner user.
                        billed_legal_entities_id:
                          type: array
                          items:
                            type: integer
                          description: Legal entity ID(s) of the client.
                        billed_clients_id:
                          type: array
                          items:
                            type: integer
                          description: Client ID(s).
                        billed_accounts_id:
                          type: array
                          items:
                            type: integer
                          description: Account ID(s) of the client.
                        billed_src_party_id:
                          type: string
                          description: Source party ID as used for billing.
                        billed_dst_party_id:
                          type: string
                          description: Destination party ID as used for billing.
                        billed_rates_id:
                          type: array
                          items:
                            type: integer
                          description: Rate ID(s) used for billing.
                        billed_volume:
                          type: array
                          minItems: 2
                          maxItems: 2
                          items:
                            type: number
                            format: decimal
                          example:
                          - 0.1
                          - 10.1
                          description: Billed volume (duration).
                        billed_currencies_id:
                          type: array
                          items:
                            type: integer
                          description: Currency ID(s) used for billing.
                        billed_cost_net:
                          type: array
                          minItems: 2
                          maxItems: 2
                          items:
                            type: number
                            format: decimal
                          example:
                          - 0.1
                          - 10.1
                          description: Billed cost (net).
                        billed_cost_tax:
                          type: array
                          minItems: 2
                          maxItems: 2
                          items:
                            type: number
                            format: decimal
                          example:
                          - 0.1
                          - 10.1
                          description: Billed tax value.
                        billed_tags:
                          type: array
                          items:
                            type: string
                          description: Dynamic tags of the xDR after billing.
                        billed_clients_matched:
                          type: boolean
                          description: If `True` returns only xDRs where client has
                            been successfully identified. If `False` returns only
                            xDRs where client has not been identified. If not given,
                            the filtering is not applied.
                        billed_rates_matched:
                          type: string
                          enum:
                          - matched
                          - deleted
                          - mismatched
                          description: Defines the match status of the rate used for
                            billing. If not given, the filtering is not applied.
                        clients_call_shops_id:
                          type: array
                          items:
                            type: integer
                          description: DEPRECATED. Call shop ID(s).
                        clients_tags:
                          type: array
                          items:
                            type: string
                          description: Client tag(s).
                        accounts_tags:
                          type: array
                          items:
                            type: string
                          description: Account tag(s).
                        clients_type:
                          type: array
                          items:
                            type: integer
                            enum:
                            - 0
                            - 3
                            - 10
                          description: Client type(s).
                        rates_value:
                          type: array
                          minItems: 2
                          maxItems: 2
                          items:
                            type: number
                            format: decimal
                          example:
                          - 0.1
                          - 10.1
                          description: Rate value range.
                        rates_pay_setup:
                          type: array
                          minItems: 2
                          maxItems: 2
                          items:
                            type: number
                            format: decimal
                          example:
                          - 0.1
                          - 10.1
                          description: Setup fee range.
                        rates_time_profiles_id:
                          type: array
                          items:
                            type: integer
                          description: Time profile ID(s).
                        rates_dst_code:
                          type: array
                          items:
                            type: string
                          description: Destination rate code(s).
                        rates_dst_code_name:
                          type: array
                          items:
                            type: string
                          description: Destination rate code name(s).
                        rates_dst_code_country:
                          type: array
                          items:
                            type: string
                          description: Destination rate code country(s).
                        rates_src_code:
                          type: array
                          items:
                            type: string
                          description: Source rate code(s).
                        rates_src_code_name:
                          type: array
                          items:
                            type: string
                          description: Source rate code name(s).
                        rates_src_code_country:
                          type: array
                          items:
                            type: string
                          description: Source rate code country(s).
                        packages_id:
                          type: array
                          items:
                            type: integer
                          description: Package ID(s) used for billing.
                        billed_cpl_money:
                          type: array
                          minItems: 2
                          maxItems: 2
                          items:
                            type: number
                            format: decimal
                          example:
                          - 0.1
                          - 10.1
                          description: Cost that has been used from the subscription
                            entitlement.
                        billed_cpl_volume:
                          type: array
                          minItems: 2
                          maxItems: 2
                          items:
                            type: number
                            format: decimal
                          example:
                          - 0.1
                          - 10.1
                          description: Volume that has been used from the subscription
                            entitlement.
                        without_packages:
                          type: boolean
                          description: If `True`, returns only xDRs that have not
                            been billed through packages.
                        invoices_type:
                          type: string
                          enum:
                          - in
                          - out
                          description: Special filter for invoicing purposes. If given,
                            returns only xDRs applicable to the given invoice type.
                        include_zero_cost:
                          type: boolean
                          description: Special filter for invoicing purposes. If `True`,
                            returns only xDRs with non-zero cost or billed through
                            packages.
                        synced_in_summary:
                          type: boolean
                          description: If `True`, returns only xDRs that have been
                            synced in the summary table.
                      required:
                      - date
                      dependentRequired: {}
                      description: Filters for data querying.
                    dst_code_decks_id:
                      type:
                      - integer
                      - 'null'
                      description: Code deck ID to use for destination codes. If not
                        set, destination codes will be returned according to the code
                        deck of the rate table used for billing.
                      default: null
                  required:
                  - filters
                  dependentRequired: {}
                  description: Query to match xDR records to be processed.
              required:
              - status
              - estimated_events
              - query
              dependentRequired: {}
    get:
      tags:
      - aaa.rerating
      operationId: aaa.rerating.search
      summary: List queue items
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of the re-rating queue item objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        aaa.rerating.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - id
                    - -id
                    - status
                    - -status
                  default: []
                  description: List of columns to order results by.
                id:
                  type: integer
                  description: Re-rating queue item ID
                status:
                  type: string
                  enum:
                  - enqueue
                  - processing
                  - completed
                  description: Status.
              required: []
              dependentRequired: {}
  /aaa/rerating/{id}:
    get:
      tags:
      - aaa.rerating
      operationId: aaa.rerating.get
      summary: Get queue item
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Rerating queue item ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Rerating queue item object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        aaa.rerating.get

        :::


        '
    patch:
      tags:
      - aaa.rerating
      operationId: aaa.rerating.update
      summary: Update queue item
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Rerating queue item ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of rows affected
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        aaa.rerating.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                status:
                  type: string
                  enum:
                  - enqueue
                  - processing
                  - completed
                  description: 'Rerating status. Should be set to `enqueue`. Other
                    statuses

                    are reserved for internal use.'
                estimated_events:
                  type: integer
                  minimum: 1
                  description: 'Estimated number of events to be processed. The

                    value should be preliminarily estimated by pulling xDR records

                    according to the query.'
                query:
                  type: object
                  properties:
                    filters:
                      type: object
                      properties:
                        date:
                          type: array
                          minItems: 2
                          maxItems: 2
                          items:
                            type: string
                            format: date-time
                          example:
                          - '2025-06-10T10:00:00.000Z'
                          - '2025-07-02T16:00:00.000Z'
                          description: Date range.
                        id:
                          type: array
                          items:
                            type: integer
                          description: xDR leg ID.
                        origin:
                          type: string
                          enum:
                          - orig
                          - term
                          description: xDR leg origin.
                        equipment_id:
                          type: array
                          items:
                            type: integer
                          description: Equipment ID.
                        result_code:
                          type: array
                          items:
                            type: integer
                          description: xDR leg result code.
                        result_status:
                          type: array
                          items:
                            type: string
                            enum:
                            - success
                            - busy
                            - nochannel
                            - error
                          description: xDR leg result status. Determined by the result
                            code.
                        session_id:
                          type: array
                          items:
                            type: string
                          description: xDR session ID.
                        volume:
                          type: array
                          minItems: 2
                          maxItems: 2
                          items:
                            type: number
                            format: decimal
                          example:
                          - 0.1
                          - 10.1
                          description: Event volume (duration). Defined as a range.
                        volume_notzero:
                          type: boolean
                          description: If `True`, only events with non-zero volume
                            (duration) will be returned.
                        pdd:
                          type: array
                          minItems: 2
                          maxItems: 2
                          items:
                            type: number
                            format: decimal
                          example:
                          - 0.1
                          - 10.1
                          description: PDD range.
                        scd:
                          type: array
                          minItems: 2
                          maxItems: 2
                          items:
                            type: number
                            format: decimal
                          example:
                          - 0.1
                          - 10.1
                          description: SCD range.
                        status:
                          type: string
                          enum:
                          - processed
                          - in_rerating
                          - new
                          description: xDR processing status.
                        src_party_id_ext:
                          type: string
                          description: Source party ID.
                        dst_party_id_ext:
                          type: string
                          description: Destination party ID.
                        src_party_id_bill:
                          type: string
                          description: Source party ID pre-processed by equipment
                            for billing.
                        dst_party_id_bill:
                          type: string
                          description: Destination party ID pre-processed by equipment
                            for billing.
                        billed_services_id:
                          type: array
                          items:
                            type: integer
                          description: Service ID(s).
                        billed_companies_id:
                          type: array
                          items:
                            type: integer
                          description: Partition ID(s) of the client.
                        owner_users_id:
                          type: array
                          items:
                            type: integer
                          description: Owner user ID(s) of the client.
                        billed_owner_companies_id:
                          type: array
                          items:
                            type: integer
                          description: Partition ID(s) of the owner user.
                        billed_legal_entities_id:
                          type: array
                          items:
                            type: integer
                          description: Legal entity ID(s) of the client.
                        billed_clients_id:
                          type: array
                          items:
                            type: integer
                          description: Client ID(s).
                        billed_accounts_id:
                          type: array
                          items:
                            type: integer
                          description: Account ID(s) of the client.
                        billed_src_party_id:
                          type: string
                          description: Source party ID as used for billing.
                        billed_dst_party_id:
                          type: string
                          description: Destination party ID as used for billing.
                        billed_rates_id:
                          type: array
                          items:
                            type: integer
                          description: Rate ID(s) used for billing.
                        billed_volume:
                          type: array
                          minItems: 2
                          maxItems: 2
                          items:
                            type: number
                            format: decimal
                          example:
                          - 0.1
                          - 10.1
                          description: Billed volume (duration).
                        billed_currencies_id:
                          type: array
                          items:
                            type: integer
                          description: Currency ID(s) used for billing.
                        billed_cost_net:
                          type: array
                          minItems: 2
                          maxItems: 2
                          items:
                            type: number
                            format: decimal
                          example:
                          - 0.1
                          - 10.1
                          description: Billed cost (net).
                        billed_cost_tax:
                          type: array
                          minItems: 2
                          maxItems: 2
                          items:
                            type: number
                            format: decimal
                          example:
                          - 0.1
                          - 10.1
                          description: Billed tax value.
                        billed_tags:
                          type: array
                          items:
                            type: string
                          description: Dynamic tags of the xDR after billing.
                        billed_clients_matched:
                          type: boolean
                          description: If `True` returns only xDRs where client has
                            been successfully identified. If `False` returns only
                            xDRs where client has not been identified. If not given,
                            the filtering is not applied.
                        billed_rates_matched:
                          type: string
                          enum:
                          - matched
                          - deleted
                          - mismatched
                          description: Defines the match status of the rate used for
                            billing. If not given, the filtering is not applied.
                        clients_call_shops_id:
                          type: array
                          items:
                            type: integer
                          description: DEPRECATED. Call shop ID(s).
                        clients_tags:
                          type: array
                          items:
                            type: string
                          description: Client tag(s).
                        accounts_tags:
                          type: array
                          items:
                            type: string
                          description: Account tag(s).
                        clients_type:
                          type: array
                          items:
                            type: integer
                            enum:
                            - 0
                            - 3
                            - 10
                          description: Client type(s).
                        rates_value:
                          type: array
                          minItems: 2
                          maxItems: 2
                          items:
                            type: number
                            format: decimal
                          example:
                          - 0.1
                          - 10.1
                          description: Rate value range.
                        rates_pay_setup:
                          type: array
                          minItems: 2
                          maxItems: 2
                          items:
                            type: number
                            format: decimal
                          example:
                          - 0.1
                          - 10.1
                          description: Setup fee range.
                        rates_time_profiles_id:
                          type: array
                          items:
                            type: integer
                          description: Time profile ID(s).
                        rates_dst_code:
                          type: array
                          items:
                            type: string
                          description: Destination rate code(s).
                        rates_dst_code_name:
                          type: array
                          items:
                            type: string
                          description: Destination rate code name(s).
                        rates_dst_code_country:
                          type: array
                          items:
                            type: string
                          description: Destination rate code country(s).
                        rates_src_code:
                          type: array
                          items:
                            type: string
                          description: Source rate code(s).
                        rates_src_code_name:
                          type: array
                          items:
                            type: string
                          description: Source rate code name(s).
                        rates_src_code_country:
                          type: array
                          items:
                            type: string
                          description: Source rate code country(s).
                        packages_id:
                          type: array
                          items:
                            type: integer
                          description: Package ID(s) used for billing.
                        billed_cpl_money:
                          type: array
                          minItems: 2
                          maxItems: 2
                          items:
                            type: number
                            format: decimal
                          example:
                          - 0.1
                          - 10.1
                          description: Cost that has been used from the subscription
                            entitlement.
                        billed_cpl_volume:
                          type: array
                          minItems: 2
                          maxItems: 2
                          items:
                            type: number
                            format: decimal
                          example:
                          - 0.1
                          - 10.1
                          description: Volume that has been used from the subscription
                            entitlement.
                        without_packages:
                          type: boolean
                          description: If `True`, returns only xDRs that have not
                            been billed through packages.
                        invoices_type:
                          type: string
                          enum:
                          - in
                          - out
                          description: Special filter for invoicing purposes. If given,
                            returns only xDRs applicable to the given invoice type.
                        include_zero_cost:
                          type: boolean
                          description: Special filter for invoicing purposes. If `True`,
                            returns only xDRs with non-zero cost or billed through
                            packages.
                        synced_in_summary:
                          type: boolean
                          description: If `True`, returns only xDRs that have been
                            synced in the summary table.
                      required:
                      - date
                      dependentRequired: {}
                      description: Filters for data querying.
                    dst_code_decks_id:
                      type:
                      - integer
                      - 'null'
                      description: Code deck ID to use for destination codes. If not
                        set, destination codes will be returned according to the code
                        deck of the rate table used for billing.
                      default: null
                  required:
                  - filters
                  dependentRequired: {}
                  description: Query to match xDR records to be processed.
              required:
              - status
              - estimated_events
              - query
              dependentRequired: {}
  /aaa/sessions/start:
    post:
      tags:
      - aaa.sessions
      operationId: aaa.sessions.start
      summary: Track session start
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: None on success. Error is raised otherwise.
          content:
            application/json:
              schema:
                type: 'null'
      description: ':::note[JSON-RPC]

        aaa.sessions.start

        :::


        The method is used to track the start of a session within active sessions.

        The use case is to track active sessions for the purpose of the capacity

        control and "Active Sessions" report available in the system.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                xdr:
                  type: object
                  properties:
                    origin:
                      type: string
                      enum:
                      - orig
                      - term
                      description: Event origin.
                    equipment_id:
                      type: integer
                      description: Equipment ID that handles the current event.
                    services_code:
                      type: string
                      maxLength: 255
                      description: Service identification code. As defined in the
                        `code` of the service being used by the current event. Used
                        for identification of the service.
                    leg_id:
                      type: string
                      maxLength: 255
                      description: Leg ID. Unique identifier generated by the equipment.
                        Must be unique among all event legs (origination or terminations
                        parts of the session) from the same equipment.
                    session_id:
                      type: string
                      maxLength: 255
                      description: Session ID. Unique identifier of the session. Must
                        be the same for both origination and termination legs of the
                        event.
                    subscriber_host:
                      type:
                      - string
                      - 'null'
                      format: cidr
                      description: Subscriber IP address. It will be matched against
                        accounts defined with `ip` identification method.
                      default: null
                    subscriber_id:
                      type:
                      - string
                      - 'null'
                      maxLength: 255
                      description: Subscriber name, will be matched against accounts
                        defined with `name` identification method.
                      default: null
                    src_party_id:
                      type:
                      - string
                      - 'null'
                      maxLength: 255
                      description: Source party ID (number). Will be used for billing
                        if `rate_<origin>_party_id` flag on the respective equipment
                        is `True`.
                      default: null
                    src_party_id_bill:
                      type:
                      - string
                      - 'null'
                      maxLength: 255
                      description: Source party billing ID (number). Will be used
                        for billing if `rate_<origin>_party_id` flag on the respective
                        equipment is `False`.
                      default: null
                    dst_party_id:
                      type:
                      - string
                      - 'null'
                      maxLength: 255
                      description: Destination party ID (number). Will be used for
                        billing if `rate_<origin>_party_id` flag on the respective
                        equipment is `True`.
                      default: null
                    dst_party_id_bill:
                      type:
                      - string
                      - 'null'
                      maxLength: 255
                      description: Destination party billing ID (number). Will be
                        used for billing if `rate_<origin>_party_id` flag on the respective
                        equipment is `False`.
                      default: null
                    setup_time:
                      type:
                      - string
                      - 'null'
                      format: date-time
                      description: Event setup timestamp.
                      default: now()
                    start_time:
                      type:
                      - string
                      - 'null'
                      format: date-time
                      description: Event start timestamp. For events that last over
                        time, this field represents the start of the activity (e.g.
                        for calls, this is the time when the call was connected).
                      default: now()
                  required:
                  - origin
                  - equipment_id
                  - services_code
                  - leg_id
                  - session_id
                  dependentRequired: {}
                  description: xDR object.
              required:
              - xdr
              dependentRequired: {}
  /aaa/sessions/stop:
    post:
      tags:
      - aaa.sessions
      operationId: aaa.sessions.stop
      summary: Track session stop
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: None on success. Error is raised otherwise.
          content:
            application/json:
              schema:
                type: 'null'
      description: ':::note[JSON-RPC]

        aaa.sessions.stop

        :::


        The method is used to track the stop of a session within active sessions.

        It removes active session record from the registry and updates capacities.


        :::warning

        The method affects only active sessions registry and tracking of capacities.

        It does not store xDR records. Use "xDRs processing / Store xDR" for this

        purpose.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                xdr:
                  type: object
                  properties:
                    equipment_id:
                      type: integer
                      description: Equipment ID that handles the current event.
                    origin:
                      type: string
                      enum:
                      - orig
                      - term
                      description: Event origin.
                    leg_id:
                      type: string
                      maxLength: 255
                      description: Leg ID. Unique identifier generated by the equipment.
                        Must be unique among all event legs (origination or terminations
                        parts of the session) from the same equipment.
                  required:
                  - equipment_id
                  - origin
                  - leg_id
                  dependentRequired: {}
                  description: xDR object.
              required:
              - xdr
              dependentRequired: {}
  /aaa/traffic_rules:
    post:
      tags:
      - aaa.traffic_rules
      operationId: aaa.traffic_rules.create
      summary: Create traffic rule
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Traffic rule object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ":::note[JSON-RPC]\naaa.traffic_rules.create\n:::\n\n:::info Rule\
        \ types\nThe type of the traffic rule defines when the rule will be executed:\n\
        \    * `initial` - before the client identification, can be used to\n    \
        \    apply processing regardless of the client;\n    * `after-client` - after\
        \ client has been identified, can be used to\n        apply processing based\
        \ on the client;\n    * `after-rate` - after service and rate have been identified,\
        \ can\n        be used to apply processing based on the service and its rate;\n\
        \    * `after-routing` - during dynamic routing, after list of vendors\n \
        \       for routing has been selected, can be used to apply processing\n \
        \       based on the routing result.\n:::\n\n:::info Rule modes\nThe mode\
        \ of the traffic rule defines what happens when the rule is applied:\n   \
        \ * `allow` - once rule is applied, the system will stop looking for\n   \
        \     other matching rules and will allow event to pass;\n    * `allow-continue`\
        \ - once rule is applied, the system will re-iterate\n        over matching\
        \ possible rules and apply them in order of priority;\n    * `deny` - the\
        \ rule simply denies the event and stops further processing.\n:::"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                companies_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: Partition ID.
                origin:
                  type: string
                  enum:
                  - orig
                  - term
                  default: orig
                  description: Traffic origin.
                type:
                  type: string
                  enum:
                  - initial
                  - after-client
                  - after-rate
                  - after-routing
                  default: after-client
                  description: Rule type.
                src_code_decks_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Code deck ID to use for determining source code

                    name in all source name fields.'
                dst_code_decks_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Code deck ID to use for determining destination

                    code name in all destination name fields.'
                order:
                  type: integer
                  minimum: 0
                  maximum: 2147483647
                  default: 1
                  description: 'Invocation order of the rule. Rules with lowest order

                    will be applied first.'
                expire_dt:
                  type:
                  - string
                  - 'null'
                  format: date-time
                  default: null
                  description: Expiration date.
                notes:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Notes.
                services_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Matching: service ID.'
                equipment_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Matching: equipment ID.'
                src_match:
                  type:
                  - string
                  - 'null'
                  format: regex
                  default: null
                  description: 'Matching: regular expression which will be matched
                    against

                    `src_party_id`.'
                src_prefixes_any:
                  type: array
                  items:
                    type: string
                  default: []
                  description: 'Matching: prefix(es) to match within `src_party_id`,

                    using "match any" logic.'
                src_prefixes_not:
                  type: array
                  items:
                    type: string
                  default: []
                  description: 'Matching: prefix(es) to match within `src_party_id`,

                    using "not match" logic.'
                src_prefixes_names_any:
                  type: array
                  items:
                    type: string
                  default: []
                  description: 'Matching: code name(s) that will be extended

                    to the list of codes and matched as prefixes within `src_party_id`,

                    using "match any" logic.'
                src_prefixes_names_not:
                  type: array
                  items:
                    type: string
                  default: []
                  description: 'Matching: code name(s) that will be extended

                    to the list of codes and matched as prefixes within `src_party_id`,

                    using "not match" logic.'
                dst_match:
                  type:
                  - string
                  - 'null'
                  format: regex
                  default: null
                  description: 'Matching: regular expression which will be matched
                    against

                    `dst_party_id`.'
                dst_prefixes_any:
                  type: array
                  items:
                    type: string
                  default: []
                  description: 'Matching: prefix(es) to match within `dst_party_id`,

                    using "match any" logic.'
                dst_prefixes_not:
                  type: array
                  items:
                    type: string
                  default: []
                  description: 'Matching: prefix(es) to match within `dst_party_id`,

                    using "not match" logic.'
                dst_prefixes_names_any:
                  type: array
                  items:
                    type: string
                  default: []
                  description: 'Matching: code name(s) that will be extended

                    to the list of codes and matched as prefixes within `dst_party_id`,

                    using "match any" logic.'
                dst_prefixes_names_not:
                  type: array
                  items:
                    type: string
                  default: []
                  description: 'Matching: code name(s) that will be extended

                    to the list of codes and matched as prefixes within `dst_party_id`,

                    using "not match" logic.'
                clients_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: Client ID(s) to match. Can not be used for `initial`
                    type.
                accounts_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: Account ID(s) to match. Can not be used for `initial`
                    type.
                dst_code:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Destination code to match. Based on the rate used
                    for the

                    event. Can not be used for `initial` and `after-client` types.'
                dst_code_name:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Destination code name to match. Based on the rate
                    used

                    for the event. Can not be used for `initial` and `after-client`
                    types.'
                src_code:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Source code to match. Based on the rate used for the
                    event.

                    Can not be used for `initial` and `after-client` types.'
                src_code_name:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Source code name to match. Based on the rate used
                    for

                    the event. Can not be used for `initial` and `after-client` types.'
                tags_any:
                  type: array
                  items:
                    type: string
                  default: []
                  description: 'Matching: tag(s), uses "match any" logic.'
                tags_all:
                  type: array
                  items:
                    type: string
                  default: []
                  description: 'Matching: tag(s), uses "match all" logic.'
                tags_not:
                  type: array
                  items:
                    type: string
                  default: []
                  description: 'Matching: tag(s), uses "not match" logic.'
                volume:
                  type:
                  - array
                  - 'null'
                  minItems: 2
                  maxItems: 2
                  items:
                    type: number
                    format: decimal
                  example:
                  - 0.1
                  - 10.1
                  default: null
                  description: Volume to match, given as range.
                mode:
                  type: string
                  enum:
                  - allow
                  - allow-continue
                  - deny
                  default: allow
                  description: 'Action: mode.'
                tags_add:
                  type: array
                  items:
                    type: string
                  default: []
                  description: 'Action: tag(s) to add to the event.'
                lnp_collectors_id:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Number portability: collector ID to use for LNP/MNP

                    dipping. If this field is not empty, it basically enables

                    number portability processing.'
                lnp_party_id:
                  type: string
                  enum:
                  - dst_party_id
                  - src_party_id
                  - both_party_ids
                  default: dst_party_id
                  description: 'Number portability: party ID to use during dipping.'
                lnp_revert:
                  type: boolean
                  default: false
                  description: 'Number portability: if `True`, the system will revert

                    original number before sending routing response.'
                import_id:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Import ID. For internal usage only.
                nanp_processing:
                  type: boolean
                  default: false
                  description: 'Number portability: if `True`, the system will execute

                    NANP database lookup for the number to define categories the number

                    belongs to.'
                translations:
                  type:
                  - array
                  - 'null'
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                        - src
                        - dst
                        description: Type of the translation.
                      order:
                        type: integer
                        minimum: 0
                        maximum: 2147483647
                        description: Order of execution. Translations will run sequentially
                          from lowest to highest.
                      match:
                        type: string
                        format: regex
                        description: Regular expression to match. Syntax is according
                          to POSIX regular expressions.
                      replace:
                        type: string
                        description: Replacement string for matched blocks. The is
                          according to POSIX regular expressions.
                    required:
                    - type
                    - order
                    - match
                    - replace
                    dependentRequired:
                      replace:
                      - match
                  default: null
                  description: List of number(s) translations to apply.
                block_clients_ids:
                  type:
                  - array
                  - 'null'
                  items:
                    type: integer
                  default: null
                  description: 'Routing blocking: Client ID(s) of the terminators

                    that are not allowed to be used during routing. This field can
                    be

                    defined for all rule types except `after-routing`.'
                block_accounts_ids:
                  type:
                  - array
                  - 'null'
                  items:
                    type: integer
                  default: null
                  description: 'Routing blocking: Account ID(s) of the terminators

                    that are not allowed to be used during routing. This field can
                    be

                    defined for all rule types except `after-routing`.'
              required: []
              dependentRequired:
                src_prefixes_names_any:
                - src_code_decks_id
                src_prefixes_names_not:
                - src_code_decks_id
                dst_prefixes_names_any:
                - dst_code_decks_id
                dst_prefixes_names_not:
                - dst_code_decks_id
    get:
      tags:
      - aaa.traffic_rules
      operationId: aaa.traffic_rules.search
      summary: List traffic rules
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of traffic rule objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        aaa.traffic_rules.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - id
                    - -id
                    - order
                    - -order
                    - origin
                    - -origin
                    - type
                    - -type
                  default: []
                  description: Rule priority order (lower values are invoked first).
                q:
                  type: string
                  description: Quick search (wildcards allowed).
                id:
                  type: integer
                  minimum: 0
                  maximum: 2147483647
                  description: Traffic rule ID.
                type:
                  type: string
                  enum:
                  - initial
                  - after-client
                  - after-rate
                  - after-routing
                  description: Rule type.
                origin:
                  type: string
                  enum:
                  - orig
                  - term
                  description: Traffic origin.
                notes:
                  type: string
                  description: Notes.
                services_id:
                  type: integer
                  description: Service ID.
                equipment_id:
                  type: integer
                  description: Equipment ID.
                src_prefix:
                  type: string
                  description: 'Filter by src prefix, matched by any of the fields

                    `src_prefixes_any`, `src_prefixes_not`, `src_prefixes_names_any`,

                    `src_prefixes_names_not`.'
                dst_prefix:
                  type: string
                  description: 'Filter by dst prefix, matched by any of the fields

                    `dst_prefixes_any`, `dst_prefixes_not`, `dst_prefixes_names_any`,

                    `dst_prefixes_names_not`.'
                clients_id:
                  type: integer
                  description: Client ID.
                clients_id_include_accounts:
                  type: integer
                  description: 'If `True`, search for rules applied to the

                    client defined by `clients_id` or any of its accounts.'
                accounts_id:
                  type: integer
                  description: Account ID.
                src_code:
                  type: string
                  description: Src code (according to the matched rate).
                dst_code:
                  type: string
                  description: Dst code (according to the matched rate).
                tag:
                  type: string
                  description: 'Filter by tag, matched by any of the fields

                    `tags_any`, `tags_all`, `tags_not`, `tags_add`.'
                mode:
                  type: string
                  enum:
                  - allow
                  - allow-continue
                  - deny
                  description: Mode.
                lnp_collectors_id:
                  type: string
                  description: Number portability collector ID.
                lnp_party_id:
                  type: string
                  enum:
                  - dst_party_id
                  - src_party_id
                  - both_party_ids
                  description: Party ID used for number portability dipping.
                import_id_not:
                  type: string
                  description: Import ID to exclude.
                from_reports_queries_id:
                  type: integer
                  description: Stored report query ID that created the rule.
                companies_id:
                  type: integer
                  description: Partition ID.
              required: []
              dependentRequired: {}
  /aaa/traffic_rules/{id}:
    delete:
      tags:
      - aaa.traffic_rules
      operationId: aaa.traffic_rules.delete
      summary: Delete traffic rule
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Traffic rule ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of rows affected
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        aaa.traffic_rules.delete

        :::


        '
    get:
      tags:
      - aaa.traffic_rules
      operationId: aaa.traffic_rules.get
      summary: Get traffic rule
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Traffic rule ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Traffic rule object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        aaa.traffic_rules.get

        :::


        '
    patch:
      tags:
      - aaa.traffic_rules
      operationId: aaa.traffic_rules.update
      summary: Update traffic rule
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Traffic rule ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        aaa.traffic_rules.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                companies_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: Partition ID.
                origin:
                  type: string
                  enum:
                  - orig
                  - term
                  default: orig
                  description: Traffic origin.
                type:
                  type: string
                  enum:
                  - initial
                  - after-client
                  - after-rate
                  - after-routing
                  default: after-client
                  description: Rule type.
                src_code_decks_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Code deck ID to use for determining source code

                    name in all source name fields.'
                dst_code_decks_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Code deck ID to use for determining destination

                    code name in all destination name fields.'
                order:
                  type: integer
                  minimum: 0
                  maximum: 2147483647
                  default: 1
                  description: 'Invocation order of the rule. Rules with lowest order

                    will be applied first.'
                expire_dt:
                  type:
                  - string
                  - 'null'
                  format: date-time
                  default: null
                  description: Expiration date.
                notes:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Notes.
                services_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Matching: service ID.'
                equipment_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Matching: equipment ID.'
                src_match:
                  type:
                  - string
                  - 'null'
                  format: regex
                  default: null
                  description: 'Matching: regular expression which will be matched
                    against

                    `src_party_id`.'
                src_prefixes_any:
                  type: array
                  items:
                    type: string
                  default: []
                  description: 'Matching: prefix(es) to match within `src_party_id`,

                    using "match any" logic.'
                src_prefixes_not:
                  type: array
                  items:
                    type: string
                  default: []
                  description: 'Matching: prefix(es) to match within `src_party_id`,

                    using "not match" logic.'
                src_prefixes_names_any:
                  type: array
                  items:
                    type: string
                  default: []
                  description: 'Matching: code name(s) that will be extended

                    to the list of codes and matched as prefixes within `src_party_id`,

                    using "match any" logic.'
                src_prefixes_names_not:
                  type: array
                  items:
                    type: string
                  default: []
                  description: 'Matching: code name(s) that will be extended

                    to the list of codes and matched as prefixes within `src_party_id`,

                    using "not match" logic.'
                dst_match:
                  type:
                  - string
                  - 'null'
                  format: regex
                  default: null
                  description: 'Matching: regular expression which will be matched
                    against

                    `dst_party_id`.'
                dst_prefixes_any:
                  type: array
                  items:
                    type: string
                  default: []
                  description: 'Matching: prefix(es) to match within `dst_party_id`,

                    using "match any" logic.'
                dst_prefixes_not:
                  type: array
                  items:
                    type: string
                  default: []
                  description: 'Matching: prefix(es) to match within `dst_party_id`,

                    using "not match" logic.'
                dst_prefixes_names_any:
                  type: array
                  items:
                    type: string
                  default: []
                  description: 'Matching: code name(s) that will be extended

                    to the list of codes and matched as prefixes within `dst_party_id`,

                    using "match any" logic.'
                dst_prefixes_names_not:
                  type: array
                  items:
                    type: string
                  default: []
                  description: 'Matching: code name(s) that will be extended

                    to the list of codes and matched as prefixes within `dst_party_id`,

                    using "not match" logic.'
                clients_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: Client ID(s) to match. Can not be used for `initial`
                    type.
                accounts_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: Account ID(s) to match. Can not be used for `initial`
                    type.
                dst_code:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Destination code to match. Based on the rate used
                    for the

                    event. Can not be used for `initial` and `after-client` types.'
                dst_code_name:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Destination code name to match. Based on the rate
                    used

                    for the event. Can not be used for `initial` and `after-client`
                    types.'
                src_code:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Source code to match. Based on the rate used for the
                    event.

                    Can not be used for `initial` and `after-client` types.'
                src_code_name:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Source code name to match. Based on the rate used
                    for

                    the event. Can not be used for `initial` and `after-client` types.'
                tags_any:
                  type: array
                  items:
                    type: string
                  default: []
                  description: 'Matching: tag(s), uses "match any" logic.'
                tags_all:
                  type: array
                  items:
                    type: string
                  default: []
                  description: 'Matching: tag(s), uses "match all" logic.'
                tags_not:
                  type: array
                  items:
                    type: string
                  default: []
                  description: 'Matching: tag(s), uses "not match" logic.'
                volume:
                  type:
                  - array
                  - 'null'
                  minItems: 2
                  maxItems: 2
                  items:
                    type: number
                    format: decimal
                  example:
                  - 0.1
                  - 10.1
                  default: null
                  description: Volume to match, given as range.
                mode:
                  type: string
                  enum:
                  - allow
                  - allow-continue
                  - deny
                  default: allow
                  description: 'Action: mode.'
                tags_add:
                  type: array
                  items:
                    type: string
                  default: []
                  description: 'Action: tag(s) to add to the event.'
                lnp_collectors_id:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Number portability: collector ID to use for LNP/MNP

                    dipping. If this field is not empty, it basically enables

                    number portability processing.'
                lnp_party_id:
                  type: string
                  enum:
                  - dst_party_id
                  - src_party_id
                  - both_party_ids
                  default: dst_party_id
                  description: 'Number portability: party ID to use during dipping.'
                lnp_revert:
                  type: boolean
                  default: false
                  description: 'Number portability: if `True`, the system will revert

                    original number before sending routing response.'
                import_id:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Import ID. For internal usage only.
                nanp_processing:
                  type: boolean
                  default: false
                  description: 'Number portability: if `True`, the system will execute

                    NANP database lookup for the number to define categories the number

                    belongs to.'
                translations:
                  type:
                  - array
                  - 'null'
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                        - src
                        - dst
                        description: Type of the translation.
                      order:
                        type: integer
                        minimum: 0
                        maximum: 2147483647
                        description: Order of execution. Translations will run sequentially
                          from lowest to highest.
                      match:
                        type: string
                        format: regex
                        description: Regular expression to match. Syntax is according
                          to POSIX regular expressions.
                      replace:
                        type: string
                        description: Replacement string for matched blocks. The is
                          according to POSIX regular expressions.
                    required:
                    - type
                    - order
                    - match
                    - replace
                    dependentRequired:
                      replace:
                      - match
                  default: null
                  description: List of number(s) translations to apply.
                block_clients_ids:
                  type:
                  - array
                  - 'null'
                  items:
                    type: integer
                  default: null
                  description: 'Routing blocking: Client ID(s) of the terminators

                    that are not allowed to be used during routing. This field can
                    be

                    defined for all rule types except `after-routing`.'
                block_accounts_ids:
                  type:
                  - array
                  - 'null'
                  items:
                    type: integer
                  default: null
                  description: 'Routing blocking: Account ID(s) of the terminators

                    that are not allowed to be used during routing. This field can
                    be

                    defined for all rule types except `after-routing`.'
              required: []
              dependentRequired:
                src_prefixes_names_any:
                - src_code_decks_id
                src_prefixes_names_not:
                - src_code_decks_id
                dst_prefixes_names_any:
                - dst_code_decks_id
                dst_prefixes_names_not:
                - dst_code_decks_id
  /aaa/xdrs:
    post:
      tags:
      - aaa.xdrs
      operationId: aaa.xdrs.save
      summary: Store xDR
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: xDR internal system ID.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        aaa.xdrs.save

        :::


        The method ingests xDR records into the system for further processing and

        billing. This is one of the methods that can be used for integration with

        custom equipment, that does not support RADIUS AAA for example.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                xdr:
                  type: object
                  properties:
                    origin:
                      type: string
                      enum:
                      - orig
                      - term
                      description: Event origin.
                    equipment_id:
                      type: integer
                      description: Equipment ID that handles the current event.
                    services_code:
                      type: string
                      maxLength: 255
                      description: Service identification code. As defined in the
                        `code` of the service being used by the current event. Used
                        for identification of the service.
                    leg_id:
                      type: string
                      maxLength: 255
                      description: Leg ID. Unique identifier generated by the equipment.
                        Must be unique among all event legs (origination or terminations
                        parts of the session) from the same equipment.
                    session_id:
                      type: string
                      maxLength: 255
                      description: Session ID. Unique identifier of the session. Must
                        be the same for both origination and termination legs of the
                        event.
                    units_id:
                      type: string
                      description: Units ID of the event.
                    volume:
                      type: number
                      format: decimal
                      description: Event volume given in units defined by `units_id`.
                    result_status:
                      type: string
                      enum:
                      - success
                      - busy
                      - nochannel
                      description: Result status. Represents category of the result
                        code.
                    subscriber_host:
                      type:
                      - string
                      - 'null'
                      format: cidr
                      description: Subscriber IP address. It will be matched against
                        accounts defined with `ip` identification method.
                      default: null
                    subscriber_id:
                      type:
                      - string
                      - 'null'
                      maxLength: 255
                      description: Subscriber name, will be matched against accounts
                        defined with `name` identification method.
                      default: null
                    src_party_id:
                      type:
                      - string
                      - 'null'
                      maxLength: 255
                      description: Source party ID (number). Will be used for billing
                        if `rate_<origin>_party_id` flag on the respective equipment
                        is `True`.
                      default: null
                    src_party_id_bill:
                      type:
                      - string
                      - 'null'
                      maxLength: 255
                      description: Source party billing ID (number). Will be used
                        for billing if `rate_<origin>_party_id` flag on the respective
                        equipment is `False`.
                      default: null
                    dst_party_id:
                      type:
                      - string
                      - 'null'
                      maxLength: 255
                      description: Destination party ID (number). Will be used for
                        billing if `rate_<origin>_party_id` flag on the respective
                        equipment is `True`.
                      default: null
                    dst_party_id_bill:
                      type:
                      - string
                      - 'null'
                      maxLength: 255
                      description: Destination party billing ID (number). Will be
                        used for billing if `rate_<origin>_party_id` flag on the respective
                        equipment is `False`.
                      default: null
                    setup_time:
                      type:
                      - string
                      - 'null'
                      format: date-time
                      description: Event setup timestamp.
                      default: now()
                    start_time:
                      type:
                      - string
                      - 'null'
                      format: date-time
                      description: Event start timestamp. For events that last over
                        time, this field represents the start of the activity (e.g.
                        for calls, this is the time when the call was connected).
                      default: now()
                    stop_time:
                      type:
                      - string
                      - 'null'
                      format: date-time
                      description: Event finish timestamp. For events that last over
                        time, this field represents the end of the activity (e.g.
                        for calls, this is the time when the call was disconnected).
                      default: now()
                    pdd:
                      type:
                      - number
                      - 'null'
                      format: decimal
                      description: Post dial delay given in units defined by `units_id`.
                      default: null
                    scd:
                      type:
                      - number
                      - 'null'
                      format: decimal
                      description: Session connect delay given in units defined by
                        `units_id`.
                      default: null
                    result_code:
                      type:
                      - integer
                      - 'null'
                      description: Result code normalized to Q.931 standard.
                      default: null
                    custom:
                      type: object
                      propertyNames:
                        type:
                        - string
                      additionalProperties:
                        type:
                        - string
                        - integer
                      maxProperties: 9
                      description: Additional xDR parameters. Not processed, for display
                        only.
                      default: {}
                  required:
                  - origin
                  - equipment_id
                  - services_code
                  - leg_id
                  - session_id
                  - units_id
                  - volume
                  - result_status
                  dependentRequired: {}
                  description: xDR object.
              required:
              - xdr
              dependentRequired: {}
  /accounting/currencies:
    post:
      tags:
      - accounting.currencies
      operationId: accounting.currencies.create
      summary: Create currency
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Currency object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        accounting.currencies.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 32
                  description: Name.
                precision_details:
                  type: integer
                  minimum: 0
                  maximum: 2147483647
                  default: 4
                  description: 'Precision (number of decimal places) used for the

                    detailed monetary values formatting (e.g. non-total rows in the

                    reports and invoices).'
                precision_totals:
                  type: integer
                  minimum: 0
                  maximum: 2147483647
                  default: 2
                  description: 'Precision (number of decimal places) used for the

                    totals monetary values formatting (e.g. total rows in the reports

                    and invoices).'
                precision_rates:
                  type: integer
                  minimum: 0
                  maximum: 2147483647
                  default: 4
                  description: 'Precision (number of decimal places) used for the

                    rates formatting (e.g. in reports and invoices).'
              required:
              - name
              dependentRequired: {}
    get:
      tags:
      - accounting.currencies
      operationId: accounting.currencies.search
      summary: List currencies
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: 'List of currency objects. Key ``rates`` contains dict with
            exchange rates

            from the current currency to the currency set by ID as each ``rates``
            key.

            If there is no exchange rate between two currencies - the value will equal

            to **None**.'
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        accounting.currencies.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - id
                    - -id
                    - name
                    - -name
                  default: []
                  description: List of columns to order results by.
                name:
                  type: string
                  description: Currency name.
                withRates:
                  type: boolean
                  default: false
                  description: Flag to return exchange rates.
              required: []
              dependentRequired: {}
  /accounting/currencies/{id}:
    delete:
      tags:
      - accounting.currencies
      operationId: accounting.currencies.delete
      summary: Delete currency
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Currency ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        accounting.currencies.delete

        :::


        Delete is possible only if the currency hasn''t been used anywhere in the

        system (e.g. invoices, clients, etc.).'
    get:
      tags:
      - accounting.currencies
      operationId: accounting.currencies.get
      summary: Get currency
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Currency ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Currency object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        accounting.currencies.get

        :::


        '
    patch:
      tags:
      - accounting.currencies
      operationId: accounting.currencies.update
      summary: Update currency
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Currency ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        accounting.currencies.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 32
                  description: Name.
                precision_details:
                  type: integer
                  minimum: 0
                  maximum: 2147483647
                  default: 4
                  description: 'Precision (number of decimal places) used for the

                    detailed monetary values formatting (e.g. non-total rows in the

                    reports and invoices).'
                precision_totals:
                  type: integer
                  minimum: 0
                  maximum: 2147483647
                  default: 2
                  description: 'Precision (number of decimal places) used for the

                    totals monetary values formatting (e.g. total rows in the reports

                    and invoices).'
                precision_rates:
                  type: integer
                  minimum: 0
                  maximum: 2147483647
                  default: 4
                  description: 'Precision (number of decimal places) used for the

                    rates formatting (e.g. in reports and invoices).'
              required:
              - name
              dependentRequired: {}
  /accounting/currencies/exchange-rate:
    get:
      tags:
      - accounting.currencies
      operationId: accounting.currencies.get_rate
      summary: Get exchange rate
      parameters:
      - in: query
        name: fromId
        schema:
          type: integer
        required: true
        description: Currency ID to convert from.
      - in: query
        name: toId
        schema:
          type: integer
        required: true
        description: Currency ID to convert to.
      - in: query
        name: effectiveAt
        schema:
          type: string
          format: date-time
          default: null
          nullable: true
        description: Timestamp at which the exchange rate should be effective.
      - in: query
        name: raise_no_rate
        schema:
          type: boolean
          default: false
        description: 'If `True`, `NotFound` exception will be raised if

          exchange rate does not exist, otherwise `None` will be returned.'
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: 'Exchange rate between two currencies. If there is no exchange
            rate present

            and `raise_no_rate` is `False` - `None` will be returned.'
          content:
            application/json:
              schema:
                type:
                - number
                - 'null'
      description: ':::note[JSON-RPC]

        accounting.currencies.get_rate

        :::


        '
  /accounting/currencies/rates:
    post:
      tags:
      - accounting.currencies.rates
      operationId: accounting.currencies.rates.create
      summary: Create exchange rate
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Exchange rate object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        accounting.currencies.rates.create

        :::


        The method will automatically create reverse rate as `rate = 1/rate`.

        For example, if you provide a rate of `1 ABC = 2 XYZ`, the method will

        automatically create a rate of `1 XYZ = 0.5 ABC`.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                currencies_id_from:
                  type: integer
                  description: Source currency ID.
                currencies_id_to:
                  type: integer
                  description: Destination currency ID.
                dt:
                  type: string
                  format: date-time
                  description: Effective date (has to be truncated to hours).
                rate:
                  type: number
                  format: decimal
                  minimum: 1.5e-08
                  maximum: 99999999.0
                  description: Exchange rate value (1 source value = X destination
                    value).
              required:
              - currencies_id_from
              - currencies_id_to
              - dt
              - rate
              dependentRequired: {}
    get:
      tags:
      - accounting.currencies.rates
      operationId: accounting.currencies.rates.search
      summary: List exchange rates
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of exchange rate objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        accounting.currencies.rates.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - dt
                    - -dt
                  default: []
                  description: List of columns to order results by.
                id:
                  type: integer
                  description: Rate ID.
                currencies_id_from:
                  type: integer
                  description: Source currency ID.
                currencies_id_to:
                  type: integer
                  description: Destination currency ID.
              required: []
              dependentRequired: {}
  /accounting/currencies/rates/{id}:
    delete:
      tags:
      - accounting.currencies.rates
      operationId: accounting.currencies.rates.delete
      summary: Delete exchange rate
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Exchange rate ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        accounting.currencies.rates.delete

        :::


        '
  /accounting/invoices/{id}:
    delete:
      tags:
      - accounting.invoices
      operationId: accounting.invoices.delete
      summary: Delete invoice
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Invoice ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        accounting.invoices.delete

        :::


        In addition to deleting the invoice, this method also deletes related tax

        balance adjustments if they were created for this invoice.'
    get:
      tags:
      - accounting.invoices
      operationId: accounting.invoices.get
      summary: Get invoice
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Invoice ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Invoice object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        accounting.invoices.get

        :::


        '
    patch:
      tags:
      - accounting.invoices
      operationId: accounting.invoices.update
      summary: Update invoice
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Invoice ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: '`True` if invoice was updated successfully. Error is raised
            otherwise.'
          content:
            application/json:
              schema:
                type: boolean
      description: ':::note[JSON-RPC]

        accounting.invoices.update

        :::


        The method allows to update only provided parameters as most of the fields

        are generated and can not be edited after invoice creation.


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                files_id:
                  type: string
                  description: File ID of the generated invoice file.
                xdrs_files_id:
                  type: string
                  description: File ID of the related xDRs List.
                peppol_files_id:
                  type: string
                  description: File ID of the invoice in PEPPOL (XML) format.
              required:
              - files_id
              - xdrs_files_id
              - peppol_files_id
              dependentRequired: {}
  /accounting/invoices:
    get:
      tags:
      - accounting.invoices
      operationId: accounting.invoices.search
      summary: List invoices
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of invoice objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        accounting.invoices.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - c_dt
                    - -c_dt
                    - due_date
                    - -due_date
                    - 'no'
                    - -no
                    - paid
                    - -paid
                    - period_finish
                    - -period_finish
                  default: []
                  description: List of columns to order results by.
                q:
                  type: string
                  description: Quick search (wildcards allowed).
                id:
                  type: array
                  items:
                    type: integer
                  description: Invoice ID.
                'no':
                  type: string
                  description: Invoice number.
                type:
                  type: string
                  enum:
                  - in
                  - out
                  description: Direction.
                state:
                  type: string
                  enum:
                  - ok
                  - to_send
                  - to_verify
                  description: State.
                c_dt:
                  type: array
                  minItems: 2
                  maxItems: 2
                  items:
                    type: string
                    format: date-time
                  example:
                  - '2025-06-10T10:00:00.000Z'
                  - '2025-07-02T16:00:00.000Z'
                  description: Creation date.
                due_date:
                  type: array
                  minItems: 2
                  maxItems: 2
                  items:
                    type: string
                    format: date-time
                  example:
                  - '2025-06-10T10:00:00.000Z'
                  - '2025-07-02T16:00:00.000Z'
                  description: Due date.
                period_finish:
                  type: array
                  minItems: 2
                  maxItems: 2
                  items:
                    type: string
                    format: date
                  example:
                  - '2025-06-10'
                  - '2025-07-02'
                  description: End date of invoicing period.
                closed:
                  type: boolean
                  description: 'Flag to return closed invoices (fully paid or covered
                    by

                    counter invoices).'
                clients_id:
                  type: array
                  items:
                    type: integer
                  description: Client ID.
                clients_tags_all:
                  type: array
                  items:
                    type: string
                  description: Client tags, uses "match all" logic.
                companies_id:
                  type: integer
                  description: Partition ID of the client.
                owner_users_id:
                  type: integer
                  description: Owner user ID of the client.
              required: []
              dependentRequired: {}
  /accounting/payment_accounts:
    post:
      tags:
      - accounting.payment_accounts
      operationId: accounting.payment_accounts.create
      summary: Create payment account
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Payment account object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        accounting.payment_accounts.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 64
                  description: Name.
                companies_id:
                  type: integer
                  description: 'Partition ID. Null value means that the payment account

                    is available for all partitions. It can be used only by the API

                    users without partition restriction.'
                sort:
                  type: integer
                  minimum: -2147483647
                  maximum: 2147483647
                  default: 100
                  description: Sort order (used for options sorting in the UI).
              required:
              - name
              - companies_id
              dependentRequired: {}
    get:
      tags:
      - accounting.payment_accounts
      operationId: accounting.payment_accounts.search
      summary: List payment accounts
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of payment account objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        accounting.payment_accounts.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - id
                    - -id
                    - name
                    - -name
                    - sort
                    - -sort
                  default: []
                  description: List of columns to order results by.
                q:
                  type: string
                  description: Quick search (wildcards allowed).
                id:
                  type: integer
                  description: Payment account ID.
                companies_id:
                  type: array
                  items:
                    type: integer
                  description: Partition ID.
                name:
                  type: string
                  description: Name.
                type:
                  type: string
                  enum:
                  - charges
                  - payments
                  default: 1
                  description: Type.
              required: []
              dependentRequired: {}
  /accounting/payment_accounts/{id}:
    delete:
      tags:
      - accounting.payment_accounts
      operationId: accounting.payment_accounts.delete
      summary: Delete payment account
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Payment account ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        accounting.payment_accounts.delete

        :::


        '
    get:
      tags:
      - accounting.payment_accounts
      operationId: accounting.payment_accounts.get
      summary: Get payment account
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Payment account ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Payment account object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        accounting.payment_accounts.get

        :::


        '
    patch:
      tags:
      - accounting.payment_accounts
      operationId: accounting.payment_accounts.update
      summary: Update payment account
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Payment account ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        accounting.payment_accounts.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 64
                  description: Name.
                companies_id:
                  type: integer
                  description: 'Partition ID. Null value means that the payment account

                    is available for all partitions. It can be used only by the API

                    users without partition restriction.'
                sort:
                  type: integer
                  minimum: -2147483647
                  maximum: 2147483647
                  default: 100
                  description: Sort order (used for options sorting in the UI).
              required:
              - name
              - companies_id
              dependentRequired: {}
  /accounting/payment_terms:
    post:
      tags:
      - accounting.payment_terms
      operationId: accounting.payment_terms.create
      summary: Create payment terms
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Payment terms object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        accounting.payment_terms.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 64
                  description: Name.
                mode:
                  type: string
                  enum:
                  - 'on'
                  - every
                  description: 'Mode. For `on` mode, `days_on` is required. For `every`
                    mode,

                    `days_every` is required.'
                grace:
                  type: integer
                  minimum: 0
                  maximum: 366
                  description: 'The number of days added to the invoice date to determine
                    the

                    due date for payment.'
                days_on:
                  type:
                  - array
                  - 'null'
                  items:
                    type: integer
                    minimum: 1
                    maximum: 28
                  default: null
                  description: 'Day(s) of the month on which the billing cycle starts.
                    The

                    invoice includes the charges from this date to the day before
                    of

                    the next billing cycle start. Required for `on` mode.'
                days_every:
                  type:
                  - integer
                  - 'null'
                  minimum: 1
                  maximum: 366
                  default: null
                  description: 'Period of the billing cycle in days. For example,
                    `7`

                    means that the billing cycle starts every 7 days. Required for

                    `every` mode.'
                notify_days_before:
                  type: array
                  items:
                    type: integer
                    minimum: 1
                    maximum: 366
                  default: []
                  description: 'Day(s) before the due date on which the reminder

                    is sent to the customer.'
                notify_days_after:
                  type: array
                  items:
                    type: integer
                    minimum: 1
                    maximum: 366
                  default: []
                  description: 'Day(s) after the due date on which the reminder

                    is sent to the customer.'
                sort:
                  type: integer
                  minimum: -2147483647
                  maximum: 2147483647
                  default: 100
                  description: Sort order (used for options sorting in the UI).
              required:
              - name
              - mode
              - grace
              dependentRequired: {}
    get:
      tags:
      - accounting.payment_terms
      operationId: accounting.payment_terms.search
      summary: List payment terms
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of payment terms objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        accounting.payment_terms.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - grace
                    - -grace
                    - id
                    - -id
                    - mode
                    - -mode
                    - name
                    - -name
                    - sort
                    - -sort
                  default: []
                  description: List of columns to order results by.
                q:
                  type: string
                  description: Quick search (wildcards allowed).
                id:
                  type: array
                  items:
                    type: integer
                  description: Payment terms ID.
                name:
                  type: string
                  description: Name.
                mode:
                  type: string
                  enum:
                  - 'on'
                  - every
                  description: Mode.
              required: []
              dependentRequired: {}
  /accounting/payment_terms/{id}:
    delete:
      tags:
      - accounting.payment_terms
      operationId: accounting.payment_terms.delete
      summary: Delete payment terms
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Payment terms ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        accounting.payment_terms.delete

        :::


        '
    get:
      tags:
      - accounting.payment_terms
      operationId: accounting.payment_terms.get
      summary: Get payment terms
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Payment terms ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Payment terms object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        accounting.payment_terms.get

        :::


        '
    patch:
      tags:
      - accounting.payment_terms
      operationId: accounting.payment_terms.update
      summary: Update payment terms
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Payment terms ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        accounting.payment_terms.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 64
                  description: Name.
                mode:
                  type: string
                  enum:
                  - 'on'
                  - every
                  description: 'Mode. For `on` mode, `days_on` is required. For `every`
                    mode,

                    `days_every` is required.'
                grace:
                  type: integer
                  minimum: 0
                  maximum: 366
                  description: 'The number of days added to the invoice date to determine
                    the

                    due date for payment.'
                days_on:
                  type:
                  - array
                  - 'null'
                  items:
                    type: integer
                    minimum: 1
                    maximum: 28
                  default: null
                  description: 'Day(s) of the month on which the billing cycle starts.
                    The

                    invoice includes the charges from this date to the day before
                    of

                    the next billing cycle start. Required for `on` mode.'
                days_every:
                  type:
                  - integer
                  - 'null'
                  minimum: 1
                  maximum: 366
                  default: null
                  description: 'Period of the billing cycle in days. For example,
                    `7`

                    means that the billing cycle starts every 7 days. Required for

                    `every` mode.'
                notify_days_before:
                  type: array
                  items:
                    type: integer
                    minimum: 1
                    maximum: 366
                  default: []
                  description: 'Day(s) before the due date on which the reminder

                    is sent to the customer.'
                notify_days_after:
                  type: array
                  items:
                    type: integer
                    minimum: 1
                    maximum: 366
                  default: []
                  description: 'Day(s) after the due date on which the reminder

                    is sent to the customer.'
                sort:
                  type: integer
                  minimum: -2147483647
                  maximum: 2147483647
                  default: 100
                  description: Sort order (used for options sorting in the UI).
              required:
              - name
              - mode
              - grace
              dependentRequired: {}
  /accounting/taxes:
    post:
      tags:
      - accounting.taxes
      operationId: accounting.taxes.create
      summary: Create tax
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Tax object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        accounting.taxes.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                taxes_profiles_id:
                  type: integer
                  description: Tax profile ID.
                name:
                  type: string
                  maxLength: 100
                  description: Name.
                value:
                  type: number
                  format: decimal
                  minimum: 0.0
                  description: Tax value (in percents).
                effective_from:
                  type:
                  - string
                  - 'null'
                  format: date-time
                  default: now()
                  description: Effective date.
                priority:
                  type: integer
                  minimum: 0
                  maximum: 2147483647
                  default: 1
                  description: 'Priority. If there are multiple taxes with the same
                    priority,

                    they will be applied simultaneously. Taxes with the next priority

                    are applied sequentially to the amount with taxes of the lower

                    priority.'
                tag:
                  type: string
                  default: '@'
                  description: Tag (tag of the rate to which this tax is applied).
              required:
              - taxes_profiles_id
              - name
              - value
              dependentRequired: {}
    get:
      tags:
      - accounting.taxes
      operationId: accounting.taxes.search
      summary: List taxes
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of tax objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        accounting.taxes.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - effective_from
                    - -effective_from
                    - id
                    - -id
                    - priority
                    - -priority
                  default: []
                  description: List of columns to order results by.
                id:
                  type: array
                  items:
                    type: integer
                  description: Tax ID.
                name:
                  type: string
                  description: Name.
                taxes_profiles_id:
                  type: integer
                  description: Tax profile ID.
                effective_from:
                  type: string
                  format: date-time
                  description: Effective date.
                tag:
                  type: array
                  items:
                    type: string
                  description: Tag(s), uses "match any" logic.
                state:
                  type: string
                  enum:
                  - current
                  - old
                  - new
                  description: Tax state at the timestamp given by `state_dt`.
                state_dt:
                  type: string
                  format: date-time
                  description: 'Date for which state is applicable, must be provided

                    if `state` is given.'
              required: []
              dependentRequired:
                state:
                - state_dt
  /accounting/taxes/{id}:
    delete:
      tags:
      - accounting.taxes
      operationId: accounting.taxes.delete
      summary: Delete tax
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Tax ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        accounting.taxes.delete

        :::


        '
    get:
      tags:
      - accounting.taxes
      operationId: accounting.taxes.get
      summary: Get tax
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Tax ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Tax object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        accounting.taxes.get

        :::


        '
    patch:
      tags:
      - accounting.taxes
      operationId: accounting.taxes.update
      summary: Update tax
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Tax ID
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        accounting.taxes.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                taxes_profiles_id:
                  type: integer
                  description: Tax profile ID.
                name:
                  type: string
                  maxLength: 100
                  description: Name.
                value:
                  type: number
                  format: decimal
                  minimum: 0.0
                  description: Tax value (in percents).
                effective_from:
                  type:
                  - string
                  - 'null'
                  format: date-time
                  default: null
                  description: Effective date.
                priority:
                  type: integer
                  minimum: 0
                  maximum: 2147483647
                  default: 1
                  description: 'Priority. If there are multiple taxes with the same
                    priority,

                    they will be applied simultaneously. Taxes with the next priority

                    are applied sequentially to the amount with taxes of the lower

                    priority.'
                tag:
                  type: string
                  default: '@'
                  description: Tag (tag of the rate to which this tax is applied).
              required:
              - taxes_profiles_id
              - name
              - value
              dependentRequired: {}
  /accounting/taxes/profiles:
    post:
      tags:
      - accounting.taxes.profiles
      operationId: accounting.taxes.profiles.create
      summary: Create tax profile
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Tax profile object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        accounting.taxes.profiles.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                companies_id:
                  type: integer
                  description: Partition ID.
                name:
                  type: string
                  maxLength: 100
                  description: Name.
                status:
                  type: string
                  enum:
                  - archive
                  - active
                  default: active
                  description: Status.
                type:
                  type: string
                  enum:
                  - suretax
                  - internal
                  - compliance
                  - avalara
                  default: internal
                  description: Type.
                external_settings:
                  oneOf:
                  - type: object
                    properties: {}
                    required: []
                    dependentRequired: {}
                    default: {}
                    title: internal
                  - type: object
                    properties:
                      client_number:
                        type: string
                        minLength: 1
                        maxLength: 10
                      validation_key:
                        type: string
                        minLength: 36
                        maxLength: 36
                      use_sandbox:
                        type: boolean
                        default: false
                      exemption_codes:
                        type: array
                        items:
                          type: string
                        default: []
                      safe_harbor:
                        type: number
                        format: decimal
                        minimum: 0.0
                        maximum: 100.0
                        default: 64.9
                      package_fee_situs_rule:
                        type:
                        - string
                        - 'null'
                        enum:
                        - '01'
                        - '02'
                        - '03'
                        - '04'
                        - '05'
                        default: null
                      package_fee_trans_type_code:
                        type:
                        - string
                        - 'null'
                        pattern: ^\d{6}$
                        default: null
                      extra_charge_situs_rule:
                        type:
                        - string
                        - 'null'
                        enum:
                        - '01'
                        - '02'
                        - '03'
                        - '04'
                        - '05'
                        default: null
                      extra_charge_trans_type_code:
                        type:
                        - string
                        - 'null'
                        pattern: ^\d{6}$
                        default: null
                      services_defaults:
                        type: array
                        items:
                          type: object
                          properties:
                            services_id:
                              type: integer
                            direction:
                              type: string
                              enum:
                              - domestic
                              - outgoing
                              - incoming
                              - foreign
                            situs_rule:
                              type:
                              - string
                              - 'null'
                              enum:
                              - '01'
                              - '02'
                              - '03'
                              - '04'
                              - '05'
                              default: null
                            trans_type_code:
                              type:
                              - string
                              - 'null'
                              pattern: ^\d{6}$
                              default: null
                          required:
                          - services_id
                          - direction
                          dependentRequired: {}
                        default: []
                    required:
                    - client_number
                    - validation_key
                    dependentRequired: {}
                    title: suretax
                  - type: object
                    properties:
                      client_access_code:
                        type: string
                      exemption_codes:
                        type: array
                        items:
                          type: string
                        default: []
                      exempt_all:
                        type: boolean
                        default: false
                      safe_harbor:
                        type: number
                        format: decimal
                        minimum: 0.0
                        maximum: 100.0
                        default: 64.9
                      package_fee_product_code:
                        type:
                        - string
                        - 'null'
                        minLength: 4
                        maxLength: 4
                        default: null
                      package_fee_service_code:
                        type:
                        - integer
                        - 'null'
                        minimum: 1
                        maximum: 999
                        default: null
                      extra_charge_product_code:
                        type:
                        - string
                        - 'null'
                        minLength: 4
                        maxLength: 4
                        default: null
                      extra_charge_service_code:
                        type:
                        - integer
                        - 'null'
                        minimum: 1
                        maximum: 999
                        default: null
                      services_defaults:
                        type: array
                        items:
                          type: object
                          properties:
                            services_id:
                              type: integer
                            product_code:
                              type:
                              - string
                              - 'null'
                              minLength: 4
                              maxLength: 4
                              default: null
                          required:
                          - services_id
                          dependentRequired: {}
                        default: []
                    required:
                    - client_access_code
                    dependentRequired: {}
                    title: compliance
                  - type: object
                    properties:
                      username:
                        type: string
                        maxLength: 256
                      password:
                        type: string
                        maxLength: 256
                      client_id:
                        type: string
                      client_profile_id:
                        type: string
                      business_class:
                        type: integer
                        minimum: 0
                        maximum: 1
                      service_class:
                        type: integer
                        minimum: 0
                        maximum: 1
                      package_fee_transaction_type:
                        type: integer
                        minimum: 0
                        maximum: 999
                      package_fee_service_type:
                        type: integer
                        minimum: 0
                        maximum: 999
                      extra_charge_transaction_type:
                        type: integer
                        minimum: 0
                        maximum: 999
                      extra_charge_service_type:
                        type: integer
                        minimum: 0
                        maximum: 999
                      use_sandbox:
                        type: boolean
                        default: false
                      company_reference:
                        type:
                        - string
                        - 'null'
                        default: null
                      facilities:
                        type: boolean
                        default: false
                      franchise:
                        type: boolean
                        default: false
                      regulated:
                        type: boolean
                        default: false
                      safe_harbor_override:
                        type:
                        - number
                        - 'null'
                        format: decimal
                        minimum: 0.0
                        maximum: 100.0
                        default: null
                      services_defaults:
                        type: array
                        items:
                          type: object
                          properties:
                            services_id:
                              type: integer
                            transaction_type:
                              type: integer
                              minimum: 0
                              maximum: 999
                            service_type:
                              type: integer
                              minimum: 0
                              maximum: 999
                          required:
                          - services_id
                          - transaction_type
                          - service_type
                          dependentRequired: {}
                        default: []
                      tax_exemptions:
                        type: array
                        items:
                          type: object
                          properties:
                            reference:
                              type: string
                              maxLength: 256
                            pcode:
                              type: string
                              maxLength: 16
                            domain:
                              type: integer
                              minimum: 0
                            category:
                              type:
                              - integer
                              - 'null'
                              minimum: 0
                              default: null
                            tax_type:
                              type:
                              - integer
                              - 'null'
                              minimum: 0
                              default: null
                            scope:
                              type: array
                              items:
                                type: integer
                                minimum: 0
                              default: []
                          required:
                          - reference
                          - pcode
                          - domain
                          dependentRequired: {}
                        default: []
                    required:
                    - username
                    - password
                    - client_id
                    - client_profile_id
                    - business_class
                    - service_class
                    - package_fee_transaction_type
                    - package_fee_service_type
                    - extra_charge_transaction_type
                    - extra_charge_service_type
                    dependentRequired: {}
                    title: avalara
                  description: 'Settings for external tax service (when `type` is

                    not `internal`). Actual structure of the settings depends on the

                    chosen external tax service provider.'
                notes:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Notes.
                invoice_notes:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Invoice notes, which will be available for use in
                    the

                    invoice template using a dedicated variable.'
                sort:
                  type: integer
                  minimum: -2147483647
                  maximum: 2147483647
                  default: 100
                  description: Sort order (used for options sorting in the UI).
              required:
              - companies_id
              - name
              dependentRequired: {}
    get:
      tags:
      - accounting.taxes.profiles
      operationId: accounting.taxes.profiles.search
      summary: List tax profiles
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of tax profile objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        accounting.taxes.profiles.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - id
                    - -id
                    - name
                    - -name
                    - sort
                    - -sort
                  default: []
                  description: List of columns to order results by.
                q:
                  type: string
                  description: Quick search (wildcards allowed).
                id:
                  type: integer
                  description: Tax profile ID.
                companies_id:
                  type: array
                  items:
                    type: integer
                  description: Partition ID.
                status:
                  type: string
                  enum:
                  - archive
                  - active
                  description: Status.
                type:
                  type: string
                  enum:
                  - suretax
                  - internal
                  - compliance
                  - avalara
                  description: Type.
              required: []
              dependentRequired: {}
  /accounting/taxes/profiles/{id}:
    delete:
      tags:
      - accounting.taxes.profiles
      operationId: accounting.taxes.profiles.delete
      summary: Delete tax profile
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Tax profile ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        accounting.taxes.profiles.delete

        :::


        Delete is possible only if the tax profile hasn''t been used anywhere in

        the system (e.g. invoices, clients, etc.).'
    get:
      tags:
      - accounting.taxes.profiles
      operationId: accounting.taxes.profiles.get
      summary: Get tax profile
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Tax profile ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Tax profile object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        accounting.taxes.profiles.get

        :::


        '
    patch:
      tags:
      - accounting.taxes.profiles
      operationId: accounting.taxes.profiles.update
      summary: Update tax profile
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Tax profile ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        accounting.taxes.profiles.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                companies_id:
                  type: integer
                  description: Partition ID.
                name:
                  type: string
                  maxLength: 100
                  description: Name.
                status:
                  type: string
                  enum:
                  - archive
                  - active
                  default: active
                  description: Status.
                external_settings:
                  oneOf:
                  - type: object
                    properties: {}
                    required: []
                    dependentRequired: {}
                    default: {}
                    title: internal
                  - type: object
                    properties:
                      client_number:
                        type: string
                        minLength: 1
                        maxLength: 10
                      validation_key:
                        type: string
                        minLength: 36
                        maxLength: 36
                      use_sandbox:
                        type: boolean
                        default: false
                      exemption_codes:
                        type: array
                        items:
                          type: string
                        default: []
                      safe_harbor:
                        type: number
                        format: decimal
                        minimum: 0.0
                        maximum: 100.0
                        default: 64.9
                      package_fee_situs_rule:
                        type:
                        - string
                        - 'null'
                        enum:
                        - '01'
                        - '02'
                        - '03'
                        - '04'
                        - '05'
                        default: null
                      package_fee_trans_type_code:
                        type:
                        - string
                        - 'null'
                        pattern: ^\d{6}$
                        default: null
                      extra_charge_situs_rule:
                        type:
                        - string
                        - 'null'
                        enum:
                        - '01'
                        - '02'
                        - '03'
                        - '04'
                        - '05'
                        default: null
                      extra_charge_trans_type_code:
                        type:
                        - string
                        - 'null'
                        pattern: ^\d{6}$
                        default: null
                      services_defaults:
                        type: array
                        items:
                          type: object
                          properties:
                            services_id:
                              type: integer
                            direction:
                              type: string
                              enum:
                              - domestic
                              - outgoing
                              - incoming
                              - foreign
                            situs_rule:
                              type:
                              - string
                              - 'null'
                              enum:
                              - '01'
                              - '02'
                              - '03'
                              - '04'
                              - '05'
                              default: null
                            trans_type_code:
                              type:
                              - string
                              - 'null'
                              pattern: ^\d{6}$
                              default: null
                          required:
                          - services_id
                          - direction
                          dependentRequired: {}
                        default: []
                    required:
                    - client_number
                    - validation_key
                    dependentRequired: {}
                    title: suretax
                  - type: object
                    properties:
                      client_access_code:
                        type: string
                      exemption_codes:
                        type: array
                        items:
                          type: string
                        default: []
                      exempt_all:
                        type: boolean
                        default: false
                      safe_harbor:
                        type: number
                        format: decimal
                        minimum: 0.0
                        maximum: 100.0
                        default: 64.9
                      package_fee_product_code:
                        type:
                        - string
                        - 'null'
                        minLength: 4
                        maxLength: 4
                        default: null
                      package_fee_service_code:
                        type:
                        - integer
                        - 'null'
                        minimum: 1
                        maximum: 999
                        default: null
                      extra_charge_product_code:
                        type:
                        - string
                        - 'null'
                        minLength: 4
                        maxLength: 4
                        default: null
                      extra_charge_service_code:
                        type:
                        - integer
                        - 'null'
                        minimum: 1
                        maximum: 999
                        default: null
                      services_defaults:
                        type: array
                        items:
                          type: object
                          properties:
                            services_id:
                              type: integer
                            product_code:
                              type:
                              - string
                              - 'null'
                              minLength: 4
                              maxLength: 4
                              default: null
                          required:
                          - services_id
                          dependentRequired: {}
                        default: []
                    required:
                    - client_access_code
                    dependentRequired: {}
                    title: compliance
                  - type: object
                    properties:
                      username:
                        type: string
                        maxLength: 256
                      password:
                        type: string
                        maxLength: 256
                      client_id:
                        type: string
                      client_profile_id:
                        type: string
                      business_class:
                        type: integer
                        minimum: 0
                        maximum: 1
                      service_class:
                        type: integer
                        minimum: 0
                        maximum: 1
                      package_fee_transaction_type:
                        type: integer
                        minimum: 0
                        maximum: 999
                      package_fee_service_type:
                        type: integer
                        minimum: 0
                        maximum: 999
                      extra_charge_transaction_type:
                        type: integer
                        minimum: 0
                        maximum: 999
                      extra_charge_service_type:
                        type: integer
                        minimum: 0
                        maximum: 999
                      use_sandbox:
                        type: boolean
                        default: false
                      company_reference:
                        type:
                        - string
                        - 'null'
                        default: null
                      facilities:
                        type: boolean
                        default: false
                      franchise:
                        type: boolean
                        default: false
                      regulated:
                        type: boolean
                        default: false
                      safe_harbor_override:
                        type:
                        - number
                        - 'null'
                        format: decimal
                        minimum: 0.0
                        maximum: 100.0
                        default: null
                      services_defaults:
                        type: array
                        items:
                          type: object
                          properties:
                            services_id:
                              type: integer
                            transaction_type:
                              type: integer
                              minimum: 0
                              maximum: 999
                            service_type:
                              type: integer
                              minimum: 0
                              maximum: 999
                          required:
                          - services_id
                          - transaction_type
                          - service_type
                          dependentRequired: {}
                        default: []
                      tax_exemptions:
                        type: array
                        items:
                          type: object
                          properties:
                            reference:
                              type: string
                              maxLength: 256
                            pcode:
                              type: string
                              maxLength: 16
                            domain:
                              type: integer
                              minimum: 0
                            category:
                              type:
                              - integer
                              - 'null'
                              minimum: 0
                              default: null
                            tax_type:
                              type:
                              - integer
                              - 'null'
                              minimum: 0
                              default: null
                            scope:
                              type: array
                              items:
                                type: integer
                                minimum: 0
                              default: []
                          required:
                          - reference
                          - pcode
                          - domain
                          dependentRequired: {}
                        default: []
                    required:
                    - username
                    - password
                    - client_id
                    - client_profile_id
                    - business_class
                    - service_class
                    - package_fee_transaction_type
                    - package_fee_service_type
                    - extra_charge_transaction_type
                    - extra_charge_service_type
                    dependentRequired: {}
                    title: avalara
                  description: 'Settings for external tax service (when `type` is

                    not `internal`). Actual structure of the settings depends on the

                    chosen external tax service provider.'
                notes:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Notes.
                invoice_notes:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Invoice notes, which will be available for use in
                    the

                    invoice template using a dedicated variable.'
                sort:
                  type: integer
                  minimum: -2147483647
                  maximum: 2147483647
                  default: 100
                  description: Sort order (used for options sorting in the UI).
              required:
              - companies_id
              - name
              dependentRequired: {}
  /accounting/topup/{id}:
    delete:
      tags:
      - accounting.topup
      operationId: accounting.topup.delete
      summary: Delete top-up card
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Top-up card ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        accounting.topup.delete

        :::


        '
    get:
      tags:
      - accounting.topup
      operationId: accounting.topup.get
      summary: Get top-up card
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Top-up card ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Top-up card object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        accounting.topup.get

        :::


        '
    patch:
      tags:
      - accounting.topup
      operationId: accounting.topup.update
      summary: Update top-up card
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Top-up card ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        accounting.topup.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                companies_id:
                  type: integer
                  description: Partition ID.
                expire_dt:
                  type: string
                  format: date-time
                  description: Expiration date.
              required:
              - companies_id
              - expire_dt
              dependentRequired: {}
  /accounting/topup/generate:
    post:
      tags:
      - accounting.topup
      operationId: accounting.topup.generate
      summary: Generate card series
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Quantity of cards generated.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        accounting.topup.generate

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                companies_id:
                  type: integer
                  description: Partition ID.
                serial:
                  type: integer
                  minimum: 1
                  description: Cards series number.
                quantity:
                  type: integer
                  minimum: 1
                  description: Quantity of cards to generate.
                pin_length:
                  type: integer
                  minimum: 8
                  description: PIN code length.
                amount:
                  type: number
                  format: decimal
                  minimum: 0.01
                  description: Cash value of a card.
                currencies_id:
                  type: integer
                  description: Currency ID.
                expire_dt:
                  type: string
                  format: date-time
                  description: Expiry date of a card.
              required:
              - companies_id
              - serial
              - quantity
              - pin_length
              - amount
              - currencies_id
              - expire_dt
              dependentRequired: {}
  /accounting/topup/redeem:
    post:
      tags:
      - accounting.topup
      operationId: accounting.topup.redeem
      summary: Redeem top-up card
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: 'An object containing details of the top-up card used and related

            transaction object.'
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        accounting.topup.redeem

        :::


        The method checks the PIN code of the top-up card and if it is valid,

        updates the card status and creates a transaction for the related client

        to refill the balance.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                clients_id:
                  type: integer
                  description: Client ID to apply the top-up card to.
                pin_code:
                  type: string
                  maxLength: 255
                  description: PIN code.
                payment_accounts_id:
                  type:
                  - integer
                  - 'null'
                  default: 1
                  description: Payment account ID to write transaction to.
              required:
              - clients_id
              - pin_code
              dependentRequired: {}
  /accounting/topup:
    get:
      tags:
      - accounting.topup
      operationId: accounting.topup.search
      summary: List top-up cards
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of top-up card objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        accounting.topup.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - activated_dt
                    - -activated_dt
                    - amount
                    - -amount
                    - c_dt
                    - -c_dt
                    - clients_id
                    - -clients_id
                    - companies_id
                    - -companies_id
                    - currencies_id
                    - -currencies_id
                    - expire_dt
                    - -expire_dt
                    - id
                    - -id
                    - number
                    - -number
                    - pin_code
                    - -pin_code
                    - serial
                    - -serial
                    - status
                    - -status
                  default: []
                  description: List of columns to order results by.
                q:
                  type: string
                  description: Quick search (wildcards allowed).
                id:
                  type: integer
                  description: Top-up card ID.
                companies_id:
                  type: integer
                  description: Partition ID.
                currencies_id:
                  type: integer
                  description: Currency ID.
                clients_id:
                  type: array
                  items:
                    type: integer
                  description: Client ID (activated by).
                status:
                  type: string
                  enum:
                  - expired
                  - new
                  - activated
                  description: Status.
                pin_code:
                  type: string
                  maxLength: 255
                  description: PIN code
                number:
                  type: string
                  description: Card sequential number (second part of serial number).
                serial:
                  type: integer
                  description: Card series (first part of serial number).
                amount:
                  type: array
                  minItems: 2
                  maxItems: 2
                  items:
                    type: number
                    format: decimal
                    minimum: 0.0
                  example:
                  - 0.1
                  - 10.1
                  description: Amount range.
                expire_dt:
                  type: array
                  minItems: 2
                  maxItems: 2
                  items:
                    type: string
                    format: date-time
                  example:
                  - '2025-06-10T10:00:00.000Z'
                  - '2025-07-02T16:00:00.000Z'
                  description: Expiry date range.
                activated_dt:
                  type: array
                  minItems: 2
                  maxItems: 2
                  items:
                    type: string
                    format: date-time
                  example:
                  - '2025-06-10T10:00:00.000Z'
                  - '2025-07-02T16:00:00.000Z'
                  description: Activation date range.
              required: []
              dependentRequired: {}
  /accounting/transactions:
    post:
      tags:
      - accounting.transactions
      operationId: accounting.transactions.create
      summary: Create transaction (postpaid)
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Transaction object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ":::note[JSON-RPC]\naccounting.transactions.create\n:::\n\n:::info\
        \ Configuring taxes\nTaxes can be set in one of two ways:\n\n1. **Using `taxes_state`**\n\
        \    - Set `taxes_state` to `included` to subtract taxes from the specified\n\
        \        `amount` according to the tax profile of the client.\n    - Set `taxes_state`\
        \ to `excluded` to calculate taxes in addition to\n        the specified `amount`.\n\
        \n2. **Providing an exact list of taxes**\n    - Pass a list of `taxes`, where\
        \ each item is a two-element array:\n        - The first element is an integer\
        \ representing the tax `id`.\n        - The second element is a decimal value\
        \ representing the tax amount.\n:::\n\n:::tip\nThis method creates a new transaction\
        \ regardless of the client balance.\n\nTo ensure transactions are created\
        \ only if the client has sufficient\nbalance, use **\"Create transaction (prepaid)\"\
        ** instead.\n:::"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                clients_id:
                  type: integer
                  description: Client ID.
                currencies_id:
                  type: integer
                  description: Currency ID.
                payment_accounts_id:
                  type: integer
                  description: Payment account ID.
                type:
                  type: string
                  enum:
                  - payment
                  - charge
                  description: 'Transaction type:

                    * `payment` represents actual payment to or from the client;

                    * `charge` represents the charge for the service being provided.'
                amount:
                  type: number
                  format: decimal
                  description: Amount.
                status:
                  type: string
                  enum:
                  - approved
                  - pending
                  default: approved
                  description: 'Status. Pending transactions are not applied to the
                    client

                    balance.'
                c_dt:
                  type:
                  - string
                  - 'null'
                  format: date-time
                  default: now()
                  description: Transaction timestamp.
                taxes_state:
                  type:
                  - string
                  - 'null'
                  enum:
                  - included
                  - excluded
                  default: null
                  description: 'Taxes state. Check method description for more details.

                    Either `taxes` or `taxes_state` should be provided, but not both.'
                taxes:
                  type:
                  - array
                  - 'null'
                  items:
                    type: object
                    properties:
                      id:
                        type: integer
                      value:
                        type: number
                        format: decimal
                  default: null
                  description: 'List of taxes. Check method description for more details.

                    Either `taxes` or `taxes_state` should be provided, but not both.'
                clients_packages_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Subscription ID. Only for `charge` type.

                    Represents the subscription that the transaction is related to.'
                invoices_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Invoice ID. Only for `charge` type. Represents the

                    invoice that includes (covers) this transaction.'
                notes:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Notes.
                system_info:
                  type:
                  - object
                  - 'null'
                  default: null
                  description: 'System info, any additional structured information
                    for

                    the transaction. To be provided in a form of JSON object.'
                send_payment_confirmation:
                  type: boolean
                  default: false
                  description: 'If `True`, a payment confirmation will be

                    sent to the client. Only for `payment` type.'
                tags:
                  type: array
                  items:
                    type: string
                  default: []
                  description: Associated tags.
              required:
              - clients_id
              - currencies_id
              - payment_accounts_id
              - type
              - amount
              dependentRequired: {}
    get:
      tags:
      - accounting.transactions
      operationId: accounting.transactions.search
      summary: List transactions
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of transaction objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        accounting.transactions.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - amount
                    - -amount
                    - c_dt
                    - -c_dt
                    - clients_id
                    - -clients_id
                    - clients_name
                    - -clients_name
                    - id
                    - -id
                    - notes
                    - -notes
                    - taxes_total
                    - -taxes_total
                    - user_name
                    - -user_name
                  default: []
                  description: List of columns to order results by.
                q:
                  type: string
                  description: Quick search (wildcards allowed).
                id:
                  type: array
                  items:
                    type: integer
                  description: Transaction ID.
                companies_id:
                  type: array
                  items:
                    type: integer
                  description: Partition ID of the client.
                owner_users_id:
                  type: integer
                  description: Owner user ID of the client.
                clients_id:
                  type: array
                  items:
                    type: integer
                  description: Client ID.
                payment_accounts_id:
                  type: array
                  items:
                    type: integer
                  description: Payment account ID.
                invoices_id:
                  type: array
                  items:
                    type: integer
                  description: Related invoice ID.
                type:
                  type: string
                  enum:
                  - payment
                  - charge
                  description: 'Transaction type:

                    * `payment` represents actual payment to or from the client;

                    * `charge` represents the charge for the service being provided.'
                status:
                  type: string
                  enum:
                  - approved
                  - pending
                  description: Status.
                covered:
                  type: boolean
                  description: Flag to return transactions covered by invoices.
                dt:
                  type: array
                  minItems: 2
                  maxItems: 2
                  items:
                    type: string
                    format: date-time
                  example:
                  - '2025-06-10T10:00:00.000Z'
                  - '2025-07-02T16:00:00.000Z'
                  description: Transaction date.
                system_info:
                  type: object
                  description: System info (wildcards allowed).
              required: []
              dependentRequired: {}
  /accounting/transactions/prepaid:
    post:
      tags:
      - accounting.transactions
      operationId: accounting.transactions.create_no_negative
      summary: Create transaction (prepaid)
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Transaction details as stored.
          content:
            application/json:
              schema:
                type: object
      description: ":::note[JSON-RPC]\naccounting.transactions.create_no_negative\n\
        :::\n\nThe method creates a transaction only if the client balance (including\n\
        the credit limit) will not become negative afterwards. Otherwise\n`LowBalanceError`\
        \ exception is raised. If client has unlimited credit,\nthe transaction is\
        \ created as usual.\n\n:::info Configuring taxes\nTaxes can be set in one\
        \ of two ways:\n\n1. **Using `taxes_state`**\n    - Set `taxes_state` to `included`\
        \ to subtract taxes from the specified\n        `amount` according to the\
        \ tax profile of the client.\n    - Set `taxes_state` to `excluded` to calculate\
        \ taxes in addition to\n        the specified `amount`.\n\n2. **Providing\
        \ an exact list of taxes**\n    - Pass a list of `taxes`, where each item\
        \ is a two-element array:\n        - The first element is an integer representing\
        \ the tax `id`.\n        - The second element is a decimal value representing\
        \ the tax amount.\n:::\n\n:::tip\nIf you need to create a transaction regardless\
        \ of the client balance,\nuse **\"Create transaction (postpaid)\"** instead.\n\
        :::"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                clients_id:
                  type: integer
                  description: Client ID.
                currencies_id:
                  type: integer
                  description: Currency ID.
                payment_accounts_id:
                  type: integer
                  description: Payment account ID.
                type:
                  type: string
                  enum:
                  - payment
                  - charge
                  description: 'Transaction type. The `payment` represents actual
                    payment to or

                    from the client, and `charge` represents the charge for the service

                    being provided.'
                amount:
                  type: number
                  format: decimal
                  description: Amount.
                status:
                  type: string
                  enum:
                  - approved
                  - pending
                  default: approved
                  description: 'Status. Pending transactions are not applied to the
                    client

                    balance.'
                c_dt:
                  type:
                  - string
                  - 'null'
                  format: date-time
                  default: now()
                  description: Transaction timestamp.
                taxes_state:
                  type:
                  - string
                  - 'null'
                  enum:
                  - included
                  - excluded
                  default: null
                  description: 'Taxes state. Check method description for more details.

                    Either `taxes` or `taxes_state` should be provided, but not both.'
                taxes:
                  type:
                  - array
                  - 'null'
                  items:
                    type: object
                    properties:
                      id:
                        type: integer
                      value:
                        type: number
                        format: decimal
                  default: null
                  description: 'List of taxes. Check method description for more details.

                    Either `taxes` or `taxes_state` should be provided, but not both.'
                clients_packages_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Subscription ID. Only for `charge` type.

                    Represents the subscription that the transaction is related to.'
                invoices_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Invoice ID. Only for `charge` type. Represents the

                    invoice that includes (covers) this transaction.'
                notes:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Notes.
                system_info:
                  type:
                  - object
                  - 'null'
                  default: null
                  description: 'System info, any additional structured information
                    for

                    the transaction. To be provided in a form of JSON object.'
                send_payment_confirmation:
                  type: boolean
                  default: false
                  description: 'If `True`, a payment confirmation will be

                    sent to the client. Only for `payment` type.'
                tags:
                  type: array
                  items:
                    type: string
                  default: []
                  description: Associated tags.
              required:
              - clients_id
              - currencies_id
              - payment_accounts_id
              - type
              - amount
              dependentRequired: {}
  /accounting/transactions/{id}:
    delete:
      tags:
      - accounting.transactions
      operationId: accounting.transactions.delete
      summary: Delete transaction
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Transaction ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        accounting.transactions.delete

        :::


        '
    get:
      tags:
      - accounting.transactions
      operationId: accounting.transactions.get
      summary: Get transaction
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Transaction ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Transaction object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        accounting.transactions.get

        :::


        '
    patch:
      tags:
      - accounting.transactions
      operationId: accounting.transactions.update
      summary: Update transaction
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Transaction ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        accounting.transactions.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                clients_id:
                  type: integer
                  description: Client ID.
                currencies_id:
                  type: integer
                  description: Currency ID.
                payment_accounts_id:
                  type: integer
                  description: Payment account ID.
                type:
                  type: string
                  enum:
                  - payment
                  - charge
                  description: 'Transaction type:

                    * `payment` represents actual payment to or from the client;

                    * `charge` represents the charge for the service being provided.'
                amount:
                  type: number
                  format: decimal
                  description: Amount.
                status:
                  type: string
                  enum:
                  - approved
                  - pending
                  default: approved
                  description: 'Status. Pending transactions are not applied to the
                    client

                    balance.'
                c_dt:
                  type:
                  - string
                  - 'null'
                  format: date-time
                  default: now()
                  description: Transaction timestamp.
                taxes_state:
                  type:
                  - string
                  - 'null'
                  enum:
                  - included
                  - excluded
                  default: null
                  description: 'Taxes state. Check method description for more details.

                    Either `taxes` or `taxes_state` should be provided, but not both.'
                taxes:
                  type:
                  - array
                  - 'null'
                  items:
                    type: object
                    properties:
                      id:
                        type: integer
                      value:
                        type: number
                        format: decimal
                  default: null
                  description: 'List of taxes. Check method description for more details.

                    Either `taxes` or `taxes_state` should be provided, but not both.'
                clients_packages_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Subscription ID. Only for `charge` type.

                    Represents the subscription that the transaction is related to.'
                invoices_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Invoice ID. Only for `charge` type. Represents the

                    invoice that includes (covers) this transaction.'
                notes:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Notes.
                system_info:
                  type:
                  - object
                  - 'null'
                  default: null
                  description: 'System info, any additional structured information
                    for

                    the transaction. To be provided in a form of JSON object.'
                tags:
                  type: array
                  items:
                    type: string
                  default: []
                  description: Associated tags.
              required:
              - clients_id
              - currencies_id
              - payment_accounts_id
              - type
              - amount
              dependentRequired: {}
  /clients/{id}/archive:
    post:
      tags:
      - clients
      operationId: clients.archive
      summary: Archive client
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Client ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        clients.archive

        :::


        This should be the default action if you want to "remove" a client. Full

        removal of the client is dangerous and should only be considered if you

        are sure that there are no references left for the client (e.g.,

        statistics, transactions, accounts, etc.).'
  /clients/authenticate:
    post:
      tags:
      - clients
      operationId: clients.authenticate
      summary: Client panel authentication
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Client object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        clients.authenticate

        :::


        The method is used to authenticate the user in the Client panel.

        On success, the client object is returned. Otherwise, the error is raised.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                cp_login:
                  type: string
                  description: Client panel login.
                cp_password:
                  type: string
                  description: Client panel password.
              required:
              - cp_login
              - cp_password
              dependentRequired: {}
  /clients:
    post:
      tags:
      - clients
      operationId: clients.create
      summary: Create client
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Client object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        clients.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                companies_id:
                  type: integer
                  description: Partition ID.
                name:
                  type: string
                  maxLength: 255
                  description: Name.
                legal_entities_id:
                  type: integer
                  description: Legal entity ID.
                currencies_id:
                  type: integer
                  description: Currency ID.
                bill_by_time:
                  type: string
                  enum:
                  - setup
                  - connect
                  - disconnect
                  description: 'Which time field of the event to use for billing.

                    The most common value is `disconnect`. Pay attention to that

                    if you use `setup` or `connect` and the event is long-lasting,

                    the invoice might be created before the event is finished,

                    resulting in that it will be missed out from the invoicing period.'
                owner_users_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: Owner user ID.
                status:
                  type: string
                  enum:
                  - active
                  - stopped
                  - expired
                  - deleted
                  default: active
                  description: Status.
                clients_templates_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Client template ID. If not given, the template

                    of the legal entity is used. If that one is not set, no template

                    is used.'
                tags:
                  type: array
                  items:
                    type: string
                  default: []
                  description: Tag(s).
                tz:
                  type:
                  - string
                  - 'null'
                  format: timezone
                  default: null
                  description: Billing timezone.
                postpaid:
                  type: boolean
                  default: false
                  description: 'Origination: if `True`, the client is postpaid. The
                    `credit`

                    field is ignored.'
                credit:
                  type:
                  - number
                  - 'null'
                  format: decimal
                  minimum: -999999999.0
                  maximum: 999999999.0
                  default: null
                  description: 'Origination: allowed credit limit for prepaid clients.'
                payment_terms_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: Payment terms ID.
                taxes_profiles_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: Tax profile ID.
                invoices_templates_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Auto-invoicing: invoice template ID.'
                autoinvoice_enabled:
                  type: boolean
                  default: false
                  description: 'Auto-invoicing: if `True`, auto-invoicing is

                    enabled.'
                autoinvoice_last:
                  type:
                  - string
                  - 'null'
                  format: date
                  default: null
                  description: 'Auto-invoicing: last date for which client has

                    been invoiced. Used to determine next invoice date (billing cycle).'
                hide_numbers:
                  type: boolean
                  default: false
                  description: 'If `True`, numbers anonymization is enabled for this

                    client. Used for anonymizing numbers in XDRs attached to the

                    invoices sent to this client.'
                vendor_credit:
                  type:
                  - number
                  - 'null'
                  format: decimal
                  minimum: -999999999.0
                  maximum: 999999999.0
                  default: null
                  description: 'Termination: vendor credit limit.'
                c_company:
                  type:
                  - string
                  - 'null'
                  maxLength: 255
                  default: null
                  description: Legal company name (used in invoices).
                c_account:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Legal bank account details (used in invoices).
                c_address:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Legal company address: street address.'
                c_city:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Legal company address: city.'
                c_country:
                  type:
                  - string
                  - 'null'
                  enum:
                  - AF
                  - AL
                  - DZ
                  - AS
                  - AD
                  - AO
                  - AI
                  - AQ
                  - AG
                  - AR
                  - AM
                  - AW
                  - AU
                  - AT
                  - AZ
                  - BS
                  - BH
                  - BD
                  - BB
                  - BY
                  - BE
                  - BZ
                  - BJ
                  - BM
                  - BT
                  - BO
                  - BQ
                  - BA
                  - BW
                  - BV
                  - BR
                  - IO
                  - BN
                  - BG
                  - BF
                  - BI
                  - CV
                  - KH
                  - CM
                  - CA
                  - KY
                  - CF
                  - TD
                  - CL
                  - CN
                  - CX
                  - CC
                  - CO
                  - KM
                  - CG
                  - CD
                  - CK
                  - CR
                  - HR
                  - CU
                  - CW
                  - CY
                  - CZ
                  - CI
                  - DK
                  - DJ
                  - DM
                  - DO
                  - EC
                  - EG
                  - SV
                  - GQ
                  - ER
                  - EE
                  - SZ
                  - ET
                  - FK
                  - FO
                  - FJ
                  - FI
                  - FR
                  - GF
                  - PF
                  - TF
                  - GA
                  - GM
                  - GE
                  - DE
                  - GH
                  - GI
                  - GR
                  - GL
                  - GD
                  - GP
                  - GU
                  - GT
                  - GG
                  - GN
                  - GW
                  - GY
                  - HT
                  - HM
                  - VA
                  - HN
                  - HK
                  - HU
                  - IS
                  - IN
                  - ID
                  - IR
                  - IQ
                  - IE
                  - IM
                  - IL
                  - IT
                  - JM
                  - JP
                  - JE
                  - JO
                  - KZ
                  - KE
                  - KI
                  - KP
                  - KR
                  - KW
                  - KG
                  - LA
                  - LV
                  - LB
                  - LS
                  - LR
                  - LY
                  - LI
                  - LT
                  - LU
                  - MO
                  - MG
                  - MW
                  - MY
                  - MV
                  - ML
                  - MT
                  - MH
                  - MQ
                  - MR
                  - MU
                  - YT
                  - MX
                  - FM
                  - MD
                  - MC
                  - MN
                  - ME
                  - MS
                  - MA
                  - MZ
                  - MM
                  - NA
                  - NR
                  - NP
                  - NL
                  - NC
                  - NZ
                  - NI
                  - NE
                  - NG
                  - NU
                  - NF
                  - MK
                  - MP
                  - 'NO'
                  - OM
                  - PK
                  - PW
                  - PS
                  - PA
                  - PG
                  - PY
                  - PE
                  - PH
                  - PN
                  - PL
                  - PT
                  - PR
                  - QA
                  - RO
                  - RU
                  - RW
                  - RE
                  - BL
                  - SH
                  - KN
                  - LC
                  - MF
                  - PM
                  - VC
                  - WS
                  - SM
                  - ST
                  - SA
                  - SN
                  - RS
                  - SC
                  - SL
                  - SG
                  - SX
                  - SK
                  - SI
                  - SB
                  - SO
                  - ZA
                  - GS
                  - SS
                  - ES
                  - LK
                  - SD
                  - SR
                  - SJ
                  - SE
                  - CH
                  - SY
                  - TW
                  - TJ
                  - TZ
                  - TH
                  - TL
                  - TG
                  - TK
                  - TO
                  - TT
                  - TN
                  - TM
                  - TC
                  - TV
                  - TR
                  - UG
                  - UA
                  - AE
                  - GB
                  - US
                  - UM
                  - UY
                  - UZ
                  - VU
                  - VE
                  - VN
                  - VG
                  - VI
                  - WF
                  - EH
                  - YE
                  - ZM
                  - ZW
                  - AX
                  default: null
                  description: 'Legal company address: country (2-letter ISO code).'
                c_zip_code:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Legal company address: postal or ZIP Code.'
                c_state:
                  type:
                  - string
                  - 'null'
                  enum:
                  - AL
                  - AK
                  - AZ
                  - AR
                  - CA
                  - CO
                  - CT
                  - DE
                  - FL
                  - GA
                  - HI
                  - ID
                  - IL
                  - IN
                  - IA
                  - KS
                  - KY
                  - LA
                  - ME
                  - MD
                  - MA
                  - MI
                  - MN
                  - MS
                  - MO
                  - MT
                  - NE
                  - NV
                  - NH
                  - NJ
                  - NM
                  - NY
                  - NC
                  - ND
                  - OH
                  - OK
                  - OR
                  - PA
                  - RI
                  - SC
                  - SD
                  - TN
                  - TX
                  - UT
                  - VT
                  - VA
                  - WA
                  - WV
                  - WI
                  - WY
                  default: null
                  description: 'Legal company address: state (2-letter ANSI code,
                    for the US only).'
                c_email:
                  type:
                  - string
                  - 'null'
                  format: email
                  default: null
                  description: Main email address (comma separated allowed).
                c_email_tech:
                  type:
                  - string
                  - 'null'
                  format: email
                  default: null
                  description: Technical email address (comma separated allowed).
                c_email_billing:
                  type:
                  - string
                  - 'null'
                  format: email
                  default: null
                  description: Billing email address (comma separated allowed).
                c_email_rates:
                  type:
                  - string
                  - 'null'
                  format: email
                  default: null
                  description: Rates email address (comma separated allowed).
                tax_id:
                  type:
                  - string
                  - 'null'
                  maxLength: 64
                  default: null
                  description: Tax ID.
                reg_id:
                  type:
                  - string
                  - 'null'
                  maxLength: 64
                  default: null
                  description: Registration ID.
                peppol_endpoint_id:
                  type:
                  - string
                  - 'null'
                  maxLength: 64
                  default: null
                  description: 'PEPPOL invoicing: company electronic address.'
                peppol_endpoint_scheme_id:
                  type:
                  - string
                  - 'null'
                  minLength: 4
                  maxLength: 4
                  default: null
                  description: 'PEPPOL invoicing: scheme code for

                    electronic address.'
                peppol_buyer_reference:
                  type:
                  - string
                  - 'null'
                  maxLength: 255
                  default: null
                  description: 'PEPPOL invoicing: reference provided by invoice

                    recipient.'
                locale:
                  type:
                  - string
                  - 'null'
                  maxLength: 3
                  default: null
                  description: Preferred locale (3 char code). Kept for backward compatibility.
                cp_enabled:
                  type: boolean
                  default: false
                  description: 'Client panel: if `True`, the client panel is enabled.'
                cp_login:
                  type:
                  - string
                  - 'null'
                  maxLength: 32
                  pattern: ^[-a-zA-Z0-9_=]+$
                  default: null
                  description: 'Client panel: login. Required if `cp_enabled` is `True`.'
                cp_password:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Client panel: password. Required if `cp_enabled` is
                    `True`.'
                orig_capacity:
                  type:
                  - integer
                  - 'null'
                  minimum: 0
                  maximum: 2147483647
                  default: null
                  description: 'Origination: concurrent channels capacity.'
                orig_rate_tables_ids:
                  type: array
                  items:
                    type: integer
                  default: []
                  description: 'Origination: rate table ID(s). If empty,

                    the rate tables of the accounts are used.'
                routing_plans_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Origination: routing plan ID. If not given, the

                    routing plans of the accounts are used.'
                orig_low_balance_profiles_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Origination: low balance profile ID.'
                term_capacity:
                  type:
                  - integer
                  - 'null'
                  minimum: 0
                  maximum: 2147483647
                  default: null
                  description: 'Termination: concurrent channels capacity.'
                term_rate_tables_ids:
                  type: array
                  items:
                    type: integer
                  default: []
                  description: 'Termination: rate table ID(s). If empty,

                    the rate tables of the accounts are used.'
                term_low_balance_profiles_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Termination: low balance profile ID.'
                low_balance_capacity:
                  type:
                  - number
                  - 'null'
                  format: decimal
                  default: null
                  description: 'Origination: low balance threshold to enforce

                    capacity limitation.'
                low_balance_capacity_value:
                  type:
                  - integer
                  - 'null'
                  minimum: 0
                  maximum: 65535
                  default: null
                  description: 'Origination: capacity limit after

                    reaching low balance threshold.'
                rates_notify_auto:
                  type: boolean
                  default: false
                  description: 'Rate notification: if `True`, rate notification

                    is enabled.'
                rates_notify_format:
                  type: string
                  enum:
                  - csv
                  - xlsx
                  default: csv
                  description: 'Rate notification: format.'
                rates_notify_type:
                  type: string
                  enum:
                  - all
                  - changed
                  - unique
                  default: all
                  description: 'Rate notification: type.'
                autocharge_enabled:
                  type: boolean
                  default: false
                  description: 'Auto-charge: if `True`, auto-charge is enabled.

                    Only if payment gateway used for the client supports auto-charge.'
                autocharge_amount:
                  type:
                  - number
                  - 'null'
                  format: decimal
                  default: null
                  description: 'Auto-charge: extra amount to be charged.'
              required:
              - companies_id
              - name
              - legal_entities_id
              - currencies_id
              - bill_by_time
              dependentRequired: {}
    get:
      tags:
      - clients
      operationId: clients.search
      summary: List clients
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of client objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        clients.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - balance
                    - -balance
                    - balance_accountant
                    - -balance_accountant
                    - balance_avail
                    - -balance_avail
                    - id
                    - -id
                    - name
                    - -name
                  default: []
                  description: List of columns to order results by.
                q:
                  type: string
                  description: Quick search (wildcards allowed).
                type:
                  type: array
                  items:
                    type: integer
                    enum:
                    - 0
                    - 3
                  default:
                  - 0
                  description: Type.
                id:
                  type: array
                  items:
                    type: integer
                  description: Client ID.
                companies_id:
                  type: array
                  items:
                    type: integer
                  description: Partition ID.
                owner_users_id:
                  type: integer
                  description: Owner user ID.
                role:
                  type: array
                  items:
                    type: string
                    enum:
                    - orig
                    - term
                    - both
                  description: 'Role, determined by presence of the respective rate
                    tables and

                    configuration of the client accounts.'
                status:
                  type: array
                  items:
                    type: string
                    enum:
                    - active
                    - stopped
                    - expired
                    - deleted
                  description: Status.
                companies_status:
                  type: string
                  enum:
                  - active
                  - stopped
                  - expired
                  - deleted
                  description: Partition status.
                routing_plans_id:
                  type: integer
                  description: Routing plan ID.
                payment_terms_id:
                  type: integer
                  description: Payment terms ID.
                taxes_profiles_id:
                  type: integer
                  description: Tax profile ID.
                orig_rate_tables_id:
                  type: array
                  items:
                    type: integer
                  description: Origination rate table ID.
                term_rate_tables_id:
                  type: array
                  items:
                    type: integer
                  description: Termination rate table ID.
                name:
                  type: string
                  description: Name (wildcards allowed).
                c_email:
                  type: string
                  description: Main e-mail (wildcards allowed).
                cp_enabled:
                  type: boolean
                  description: Is client panel enabled.
                cp_login:
                  type: string
                  description: Client panel login.
                cp_password:
                  type: string
                  description: Client panel password (in clear text).
                clients_templates_id:
                  type: integer
                  description: Client template ID.
                accounts_auth:
                  type: string
                  description: 'Authentication identifier or the related account

                    (name, ANI or IP address).'
                accounts_name:
                  type: string
                  maxLength: 64
                  description: Related account name (wildcards allowed).
                tags_all:
                  type: array
                  items:
                    type: string
                  description: Tags, uses "match all" logic.
              required: []
              dependentRequired: {}
  /clients/{id}:
    delete:
      tags:
      - clients
      operationId: clients.delete
      summary: Delete client
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Client ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        clients.delete

        :::


        Delete is possible only if the client hasn''t been used anywhere in

        the system (e.g. statistics, accounts, etc.).


        Please note, that deleting a client will require re-rating of the

        statistics if the client was used in any statistics.'
    get:
      tags:
      - clients
      operationId: clients.get
      summary: Get client
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Client ID.
      - in: query
        name: template
        schema:
          type: boolean
          default: false
        description: 'Flag to render client template. If ``True``, then returned

          details will inherit data from the client template if used.'
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Client object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        clients.get

        :::


        '
    patch:
      tags:
      - clients
      operationId: clients.update
      summary: Update client
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Client ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        clients.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                companies_id:
                  type: integer
                  description: Partition ID.
                name:
                  type: string
                  maxLength: 255
                  description: Name.
                legal_entities_id:
                  type: integer
                  description: Legal entity ID.
                currencies_id:
                  type: integer
                  description: Currency ID.
                bill_by_time:
                  type: string
                  enum:
                  - setup
                  - connect
                  - disconnect
                  description: 'Which time field of the event to use for billing.

                    The most common value is `disconnect`. Pay attention to that

                    if you use `setup` or `connect` and the event is long-lasting,

                    the invoice might be created before the event is finished,

                    resulting in that it will be missed out from the invoicing period.'
                owner_users_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: Owner user ID.
                status:
                  type: string
                  enum:
                  - active
                  - stopped
                  - expired
                  - deleted
                  default: active
                  description: Status.
                clients_templates_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Client template ID. If not given, the template

                    of the legal entity is used. If that one is not set, no template

                    is used.'
                tags:
                  type: array
                  items:
                    type: string
                  default: []
                  description: Tag(s).
                tz:
                  type:
                  - string
                  - 'null'
                  format: timezone
                  default: null
                  description: Billing timezone.
                postpaid:
                  type: boolean
                  default: false
                  description: 'Origination: if `True`, the client is postpaid. The
                    `credit`

                    field is ignored.'
                credit:
                  type:
                  - number
                  - 'null'
                  format: decimal
                  minimum: -999999999.0
                  maximum: 999999999.0
                  default: null
                  description: 'Origination: allowed credit limit for prepaid clients.'
                payment_terms_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: Payment terms ID.
                taxes_profiles_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: Tax profile ID.
                invoices_templates_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Auto-invoicing: invoice template ID.'
                autoinvoice_enabled:
                  type: boolean
                  default: false
                  description: 'Auto-invoicing: if `True`, auto-invoicing is

                    enabled.'
                autoinvoice_last:
                  type:
                  - string
                  - 'null'
                  format: date
                  default: null
                  description: 'Auto-invoicing: last date for which client has

                    been invoiced. Used to determine next invoice date (billing cycle).'
                hide_numbers:
                  type: boolean
                  default: false
                  description: 'If `True`, numbers anonymization is enabled for this

                    client. Used for anonymizing numbers in XDRs attached to the

                    invoices sent to this client.'
                vendor_credit:
                  type:
                  - number
                  - 'null'
                  format: decimal
                  minimum: -999999999.0
                  maximum: 999999999.0
                  default: null
                  description: 'Termination: vendor credit limit.'
                c_company:
                  type:
                  - string
                  - 'null'
                  maxLength: 255
                  default: null
                  description: Legal company name (used in invoices).
                c_account:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Legal bank account details (used in invoices).
                c_address:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Legal company address: street address.'
                c_city:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Legal company address: city.'
                c_country:
                  type:
                  - string
                  - 'null'
                  enum:
                  - AF
                  - AL
                  - DZ
                  - AS
                  - AD
                  - AO
                  - AI
                  - AQ
                  - AG
                  - AR
                  - AM
                  - AW
                  - AU
                  - AT
                  - AZ
                  - BS
                  - BH
                  - BD
                  - BB
                  - BY
                  - BE
                  - BZ
                  - BJ
                  - BM
                  - BT
                  - BO
                  - BQ
                  - BA
                  - BW
                  - BV
                  - BR
                  - IO
                  - BN
                  - BG
                  - BF
                  - BI
                  - CV
                  - KH
                  - CM
                  - CA
                  - KY
                  - CF
                  - TD
                  - CL
                  - CN
                  - CX
                  - CC
                  - CO
                  - KM
                  - CG
                  - CD
                  - CK
                  - CR
                  - HR
                  - CU
                  - CW
                  - CY
                  - CZ
                  - CI
                  - DK
                  - DJ
                  - DM
                  - DO
                  - EC
                  - EG
                  - SV
                  - GQ
                  - ER
                  - EE
                  - SZ
                  - ET
                  - FK
                  - FO
                  - FJ
                  - FI
                  - FR
                  - GF
                  - PF
                  - TF
                  - GA
                  - GM
                  - GE
                  - DE
                  - GH
                  - GI
                  - GR
                  - GL
                  - GD
                  - GP
                  - GU
                  - GT
                  - GG
                  - GN
                  - GW
                  - GY
                  - HT
                  - HM
                  - VA
                  - HN
                  - HK
                  - HU
                  - IS
                  - IN
                  - ID
                  - IR
                  - IQ
                  - IE
                  - IM
                  - IL
                  - IT
                  - JM
                  - JP
                  - JE
                  - JO
                  - KZ
                  - KE
                  - KI
                  - KP
                  - KR
                  - KW
                  - KG
                  - LA
                  - LV
                  - LB
                  - LS
                  - LR
                  - LY
                  - LI
                  - LT
                  - LU
                  - MO
                  - MG
                  - MW
                  - MY
                  - MV
                  - ML
                  - MT
                  - MH
                  - MQ
                  - MR
                  - MU
                  - YT
                  - MX
                  - FM
                  - MD
                  - MC
                  - MN
                  - ME
                  - MS
                  - MA
                  - MZ
                  - MM
                  - NA
                  - NR
                  - NP
                  - NL
                  - NC
                  - NZ
                  - NI
                  - NE
                  - NG
                  - NU
                  - NF
                  - MK
                  - MP
                  - 'NO'
                  - OM
                  - PK
                  - PW
                  - PS
                  - PA
                  - PG
                  - PY
                  - PE
                  - PH
                  - PN
                  - PL
                  - PT
                  - PR
                  - QA
                  - RO
                  - RU
                  - RW
                  - RE
                  - BL
                  - SH
                  - KN
                  - LC
                  - MF
                  - PM
                  - VC
                  - WS
                  - SM
                  - ST
                  - SA
                  - SN
                  - RS
                  - SC
                  - SL
                  - SG
                  - SX
                  - SK
                  - SI
                  - SB
                  - SO
                  - ZA
                  - GS
                  - SS
                  - ES
                  - LK
                  - SD
                  - SR
                  - SJ
                  - SE
                  - CH
                  - SY
                  - TW
                  - TJ
                  - TZ
                  - TH
                  - TL
                  - TG
                  - TK
                  - TO
                  - TT
                  - TN
                  - TM
                  - TC
                  - TV
                  - TR
                  - UG
                  - UA
                  - AE
                  - GB
                  - US
                  - UM
                  - UY
                  - UZ
                  - VU
                  - VE
                  - VN
                  - VG
                  - VI
                  - WF
                  - EH
                  - YE
                  - ZM
                  - ZW
                  - AX
                  default: null
                  description: 'Legal company address: country (2-letter ISO code).'
                c_zip_code:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Legal company address: postal or ZIP Code.'
                c_state:
                  type:
                  - string
                  - 'null'
                  enum:
                  - AL
                  - AK
                  - AZ
                  - AR
                  - CA
                  - CO
                  - CT
                  - DE
                  - FL
                  - GA
                  - HI
                  - ID
                  - IL
                  - IN
                  - IA
                  - KS
                  - KY
                  - LA
                  - ME
                  - MD
                  - MA
                  - MI
                  - MN
                  - MS
                  - MO
                  - MT
                  - NE
                  - NV
                  - NH
                  - NJ
                  - NM
                  - NY
                  - NC
                  - ND
                  - OH
                  - OK
                  - OR
                  - PA
                  - RI
                  - SC
                  - SD
                  - TN
                  - TX
                  - UT
                  - VT
                  - VA
                  - WA
                  - WV
                  - WI
                  - WY
                  default: null
                  description: 'Legal company address: state (2-letter ANSI code,
                    for the US only).'
                c_email:
                  type:
                  - string
                  - 'null'
                  format: email
                  default: null
                  description: Main email address (comma separated allowed).
                c_email_tech:
                  type:
                  - string
                  - 'null'
                  format: email
                  default: null
                  description: Technical email address (comma separated allowed).
                c_email_billing:
                  type:
                  - string
                  - 'null'
                  format: email
                  default: null
                  description: Billing email address (comma separated allowed).
                c_email_rates:
                  type:
                  - string
                  - 'null'
                  format: email
                  default: null
                  description: Rates email address (comma separated allowed).
                tax_id:
                  type:
                  - string
                  - 'null'
                  maxLength: 64
                  default: null
                  description: Tax ID.
                reg_id:
                  type:
                  - string
                  - 'null'
                  maxLength: 64
                  default: null
                  description: Registration ID.
                peppol_endpoint_id:
                  type:
                  - string
                  - 'null'
                  maxLength: 64
                  default: null
                  description: 'PEPPOL invoicing: company electronic address.'
                peppol_endpoint_scheme_id:
                  type:
                  - string
                  - 'null'
                  minLength: 4
                  maxLength: 4
                  default: null
                  description: 'PEPPOL invoicing: scheme code for

                    electronic address.'
                peppol_buyer_reference:
                  type:
                  - string
                  - 'null'
                  maxLength: 255
                  default: null
                  description: 'PEPPOL invoicing: reference provided by invoice

                    recipient.'
                locale:
                  type:
                  - string
                  - 'null'
                  maxLength: 3
                  default: null
                  description: Preferred locale (3 char code). Kept for backward compatibility.
                cp_enabled:
                  type: boolean
                  default: false
                  description: 'Client panel: if `True`, the client panel is enabled.'
                cp_login:
                  type:
                  - string
                  - 'null'
                  maxLength: 32
                  pattern: ^[-a-zA-Z0-9_=]+$
                  default: null
                  description: 'Client panel: login. Required if `cp_enabled` is `True`.'
                cp_password:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Client panel: password. Required if `cp_enabled` is
                    `True`.'
                orig_capacity:
                  type:
                  - integer
                  - 'null'
                  minimum: 0
                  maximum: 2147483647
                  default: null
                  description: 'Origination: concurrent channels capacity.'
                orig_rate_tables_ids:
                  type:
                  - array
                  - 'null'
                  items:
                    type: integer
                  default: null
                  description: 'Origination: rate table ID(s). If empty,

                    the rate tables of the accounts are used.'
                routing_plans_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Origination: routing plan ID. If not given, the

                    routing plans of the accounts are used.'
                orig_low_balance_profiles_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Origination: low balance profile ID.'
                term_capacity:
                  type:
                  - integer
                  - 'null'
                  minimum: 0
                  maximum: 2147483647
                  default: null
                  description: 'Termination: concurrent channels capacity.'
                term_rate_tables_ids:
                  type:
                  - array
                  - 'null'
                  items:
                    type: integer
                  default: null
                  description: 'Termination: rate table ID(s). If empty,

                    the rate tables of the accounts are used.'
                term_low_balance_profiles_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Termination: low balance profile ID.'
                low_balance_capacity:
                  type:
                  - number
                  - 'null'
                  format: decimal
                  default: null
                  description: 'Origination: low balance threshold to enforce

                    capacity limitation.'
                low_balance_capacity_value:
                  type:
                  - integer
                  - 'null'
                  minimum: 0
                  maximum: 65535
                  default: null
                  description: 'Origination: capacity limit after

                    reaching low balance threshold.'
                rates_notify_auto:
                  type: boolean
                  default: false
                  description: 'Rate notification: if `True`, rate notification

                    is enabled.'
                rates_notify_format:
                  type: string
                  enum:
                  - csv
                  - xlsx
                  default: csv
                  description: 'Rate notification: format.'
                rates_notify_type:
                  type: string
                  enum:
                  - all
                  - changed
                  - unique
                  default: all
                  description: 'Rate notification: type.'
                autocharge_enabled:
                  type: boolean
                  default: false
                  description: 'Auto-charge: if `True`, auto-charge is enabled.

                    Only if payment gateway used for the client supports auto-charge.'
                autocharge_amount:
                  type:
                  - number
                  - 'null'
                  format: decimal
                  default: null
                  description: 'Auto-charge: extra amount to be charged.'
                payment_systems_profiles_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Auto-charge: client payment system profile ID.'
              required:
              - companies_id
              - name
              - legal_entities_id
              - currencies_id
              - bill_by_time
              dependentRequired: {}
  /clients/rates-force-notify:
    post:
      tags:
      - clients
      operationId: clients.rates_force_notify
      summary: Send rate notification
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of rate tables to be notified.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        clients.rates_force_notify

        :::


        The method sets date of "forced" rate notification for the client. If date

        is current, the notification will be send within next execution of the

        "Rates Notificator" service.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                clients_id:
                  type: integer
                  description: Client ID to notify.
                dt:
                  type: string
                  format: date-time
                  description: Timestamp of forced notification.
              required:
              - clients_id
              - dt
              dependentRequired: {}
  /clients/accounts:
    post:
      tags:
      - clients.accounts
      operationId: clients.accounts.create
      summary: Create account
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Account object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        clients.accounts.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                clients_id:
                  type: integer
                  description: Client ID.
                name:
                  type: string
                  maxLength: 64
                  description: Name.
                auth_type:
                  type: string
                  enum:
                  - name
                  - ip
                  - ani
                  description: Type of identification.
                notes:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Notes.
                orig_tags:
                  type: array
                  items:
                    type: string
                  default: []
                  description: 'Origination: tag(s) that are assigned to the event

                    originated by the account.'
                term_tags:
                  type: array
                  items:
                    type: string
                  default: []
                  description: 'Termination: tag(s) that are assigned to the event

                    terminated by the account.'
                tech_prefix:
                  type:
                  - string
                  - 'null'
                  maxLength: 64
                  default: null
                  description: 'Technical prefix. Checked against the prefix of the

                    `dst_party_id` in the xDR. Stripped from the `dst_party_id`

                    on successful match.'
                ani:
                  type:
                  - string
                  - 'null'
                  maxLength: 64
                  default: null
                  description: 'Identification: ANI. Required when `auth_type` is
                    `ani`.'
                accname:
                  type:
                  - string
                  - 'null'
                  maxLength: 128
                  default: null
                  description: 'Identification: name. Required when `auth_type` is
                    `name`.'
                password:
                  type:
                  - string
                  - 'null'
                  maxLength: 256
                  default: null
                  description: 'Identification: password. Used with `name` auth type.

                    Should be supported by the equipment. Typically used when

                    registration of the account is done via billing system.'
                orig_enabled:
                  type: boolean
                  default: false
                  description: 'Origination: if `True`, the account is allowed to

                    originate events (calls).'
                orig_capacity:
                  type:
                  - integer
                  - 'null'
                  minimum: 0
                  maximum: 2147483647
                  default: null
                  description: 'Origination: concurrent channels capacity.'
                orig_rate_tables_ids:
                  type: array
                  items:
                    type: integer
                  default: []
                  description: 'Origination: rate table ID(s). If not given,

                    the rate tables of the client are used.'
                routing_plans_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Origination: routing plan ID. If not given, the

                    routing plan of the client is used.'
                term_enabled:
                  type: boolean
                  default: false
                  description: 'Termination: if `True`, the account is allowed to

                    terminate events (calls).'
                term_capacity:
                  type:
                  - integer
                  - 'null'
                  minimum: 0
                  maximum: 2147483647
                  default: null
                  description: 'Termination: concurrent channels capacity.'
                term_rate_tables_ids:
                  type: array
                  items:
                    type: integer
                  default: []
                  description: 'Termination: rate table ID(s). If not given,

                    the rate tables of the client are used.'
                protocol:
                  type:
                  - string
                  - 'null'
                  maxLength: 64
                  default: null
                  description: 'Termination: protocol. Should be supported by the
                    equipment.'
                port:
                  type:
                  - string
                  - 'null'
                  maxLength: 64
                  default: null
                  description: 'Termination: port. Should be supported by the equipment.'
                proxy_mode:
                  type: integer
                  minimum: 0
                  maximum: 7
                  default: 1
                  description: 'Termination: proxy mode. Should be supported by the
                    equipment.'
                ips:
                  type: array
                  items:
                    type: string
                    format: cidr
                  default: []
                  description: 'Identification: IP address(es). Required when `auth_type`

                    is `ip`.'
                equipment_ids:
                  type: array
                  items:
                    type: integer
                  default: []
                  description: 'Identification: Equipment ID(s) on which the account

                    is allowed to be used.'
              required:
              - clients_id
              - name
              - auth_type
              dependentRequired: {}
    get:
      tags:
      - clients.accounts
      operationId: clients.accounts.search
      summary: List accounts
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of account objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        clients.accounts.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - clients_name
                    - -clients_name
                    - id
                    - -id
                    - name
                    - -name
                  default: []
                  description: List of columns to order results by.
                q:
                  type: string
                  description: Quick search (wildcards allowed).
                id:
                  type: array
                  items:
                    type: integer
                  description: Account ID.
                companies_id:
                  type: array
                  items:
                    type: integer
                  description: Partition ID of the client.
                owner_users_id:
                  type: integer
                  description: Owner user ID.
                clients_id:
                  type: array
                  items:
                    type: integer
                  description: Client ID.
                clients_type:
                  type: array
                  items:
                    type: integer
                  description: Client type.
                name:
                  type: string
                  description: Name (wildcards allowed).
                tech_prefix:
                  type: string
                  description: Technical prefix.
                orig_enabled:
                  type: boolean
                  description: 'If `True`, only accounts with origination enabled
                    will

                    be returned.'
                term_enabled:
                  type: boolean
                  description: 'If `True`, only accounts with termination enabled
                    will

                    be returned.'
                orig_rate_tables_id:
                  type: array
                  items:
                    type: integer
                  description: Origination rate table ID.
                term_rate_tables_id:
                  type: array
                  items:
                    type: integer
                  description: Termination rate table ID.
                orig_rate_tables_assigned:
                  type: boolean
                  description: 'If `True`, only accounts with origination

                    rate table assigned will be returned.'
                routing_plans_id:
                  type: integer
                  description: Routing plan ID.
                auth_type:
                  type: string
                  enum:
                  - name
                  - ip
                  - ani
                  description: Authentication type.
                accounts_auth:
                  type: string
                  description: 'Authentication identifier of the account (name, ANI
                    or

                    IP address).'
                password:
                  type: string
                  description: Authentication password.
                equipment_id:
                  type: integer
                  description: Assigned equipment ID.
                orig_tags_all:
                  type: array
                  items:
                    type: string
                  description: Origination tags, uses "match all" logic.
                term_tags_all:
                  type: array
                  items:
                    type: string
                  description: Termination tags, uses "match all" logic.
              required: []
              dependentRequired: {}
  /clients/accounts/{id}:
    delete:
      tags:
      - clients.accounts
      operationId: clients.accounts.delete
      summary: Delete account
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Account ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        clients.accounts.delete

        :::


        Please note, that deleting an account will require re-rating of the

        statistics if the account was used in any statistics.'
    get:
      tags:
      - clients.accounts
      operationId: clients.accounts.get
      summary: Get account
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Account ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Account object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        clients.accounts.get

        :::


        '
    patch:
      tags:
      - clients.accounts
      operationId: clients.accounts.update
      summary: Update account
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Account ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        clients.accounts.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::


        :::note Client relation

        Changing `clients_id` within an account is not allowed to ensure data

        consistency. To move an account between clients, disable the existing

        account and create a new one under the desired client.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 64
                  description: Name.
                auth_type:
                  type: string
                  enum:
                  - name
                  - ip
                  - ani
                  description: Type of identification.
                notes:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Notes.
                orig_tags:
                  type: array
                  items:
                    type: string
                  default: []
                  description: 'Origination: tag(s) that are assigned to the event

                    originated by the account.'
                term_tags:
                  type: array
                  items:
                    type: string
                  default: []
                  description: 'Termination: tag(s) that are assigned to the event

                    terminated by the account.'
                tech_prefix:
                  type:
                  - string
                  - 'null'
                  maxLength: 64
                  default: null
                  description: 'Technical prefix. Checked against the prefix of the

                    `dst_party_id` in the xDR. Stripped from the `dst_party_id`

                    on successful match.'
                ani:
                  type:
                  - string
                  - 'null'
                  maxLength: 64
                  default: null
                  description: 'Identification: ANI. Required when `auth_type` is
                    `ani`.'
                accname:
                  type:
                  - string
                  - 'null'
                  maxLength: 128
                  default: null
                  description: 'Identification: name. Required when `auth_type` is
                    `name`.'
                password:
                  type:
                  - string
                  - 'null'
                  maxLength: 256
                  default: null
                  description: 'Identification: password. Used with `name` auth type.

                    Should be supported by the equipment. Typically used when

                    registration of the account is done via billing system.'
                orig_enabled:
                  type: boolean
                  default: false
                  description: 'Origination: if `True`, the account is allowed to

                    originate events (calls).'
                orig_capacity:
                  type:
                  - integer
                  - 'null'
                  minimum: 0
                  maximum: 2147483647
                  default: null
                  description: 'Origination: concurrent channels capacity.'
                orig_rate_tables_ids:
                  type:
                  - array
                  - 'null'
                  items:
                    type: integer
                  default: null
                  description: 'Origination: rate table ID(s). If not given,

                    the rate tables of the client are used.'
                routing_plans_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Origination: routing plan ID. If not given, the

                    routing plan of the client is used.'
                term_enabled:
                  type: boolean
                  default: false
                  description: 'Termination: if `True`, the account is allowed to

                    terminate events (calls).'
                term_capacity:
                  type:
                  - integer
                  - 'null'
                  minimum: 0
                  maximum: 2147483647
                  default: null
                  description: 'Termination: concurrent channels capacity.'
                term_rate_tables_ids:
                  type:
                  - array
                  - 'null'
                  items:
                    type: integer
                  default: null
                  description: 'Termination: rate table ID(s). If not given,

                    the rate tables of the client are used.'
                protocol:
                  type:
                  - string
                  - 'null'
                  maxLength: 64
                  default: null
                  description: 'Termination: protocol. Should be supported by the
                    equipment.'
                port:
                  type:
                  - string
                  - 'null'
                  maxLength: 64
                  default: null
                  description: 'Termination: port. Should be supported by the equipment.'
                proxy_mode:
                  type: integer
                  minimum: 0
                  maximum: 7
                  default: 1
                  description: 'Termination: proxy mode. Should be supported by the
                    equipment.'
                ips:
                  type: array
                  items:
                    type: string
                    format: cidr
                  default: []
                  description: 'Identification: IP address(es). Required when `auth_type`

                    is `ip`.'
                equipment_ids:
                  type: array
                  items:
                    type: integer
                  default: []
                  description: 'Identification: Equipment ID(s) on which the account

                    is allowed to be used.'
              required:
              - name
              - auth_type
              dependentRequired: {}
  /clients/accounts/rates-force-notify:
    post:
      tags:
      - clients.accounts
      operationId: clients.accounts.rates_force_notify
      summary: Send rate notification
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of rate tables to be notified.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        clients.accounts.rates_force_notify

        :::


        The method sets date of "forced" rate notification for the account. If date

        is current, the notification will be send within next execution of the

        "Rates Notificator" service.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                accounts_id:
                  type: integer
                  description: Account ID to notify.
                dt:
                  type: string
                  format: date-time
                  description: Timestamp of forced notification.
              required:
              - accounts_id
              - dt
              dependentRequired: {}
  /clients/custom_fields/{id}:
    get:
      tags:
      - clients.custom_fields
      operationId: clients.custom_fields.get
      summary: Get custom fields
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Client ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Custom fields object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        clients.custom_fields.get

        :::


        '
    patch:
      tags:
      - clients.custom_fields
      operationId: clients.custom_fields.update
      summary: Update custom fields
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Client ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        clients.custom_fields.update

        :::


        The method allows extra fields to be provided according to the

        the custom fields definition. The name of the field should be

        equal to the `key` of the custom field definition.'
  /clients/notes:
    post:
      tags:
      - clients.notes
      operationId: clients.notes.create
      summary: Create client note
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Client note object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        clients.notes.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                clients_id:
                  type: integer
                  description: Client ID.
                note:
                  type: string
                  description: Note text.
                files_id:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Attachment file ID.
              required:
              - clients_id
              - note
              dependentRequired: {}
    get:
      tags:
      - clients.notes
      operationId: clients.notes.search
      summary: List client notes
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of client note objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        clients.notes.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - clients_id
                    - -clients_id
                    - dt
                    - -dt
                    - id
                    - -id
                    - users_id
                    - -users_id
                  default: []
                  description: List of columns to order results by.
                id:
                  type: array
                  items:
                    type: integer
                  description: Client note ID.
                clients_id:
                  type: array
                  items:
                    type: integer
                  description: Client ID.
                users_id:
                  type: array
                  items:
                    type: integer
                  description: User ID (author of the note).
              required: []
              dependentRequired: {}
  /clients/notes/{id}:
    delete:
      tags:
      - clients.notes
      operationId: clients.notes.delete
      summary: Delete client note
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Client note ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        clients.notes.delete

        :::


        '
    get:
      tags:
      - clients.notes
      operationId: clients.notes.get
      summary: Get client note
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Client note ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Client note object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        clients.notes.get

        :::


        '
    patch:
      tags:
      - clients.notes
      operationId: clients.notes.update
      summary: Update client note
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Client note ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        clients.notes.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                clients_id:
                  type: integer
                  description: Client ID.
                note:
                  type: string
                  description: Note text.
                files_id:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Attachment file ID.
              required:
              - clients_id
              - note
              dependentRequired: {}
  /clients/payment_systems_profiles:
    post:
      tags:
      - clients.payment_systems_profiles
      operationId: clients.payment_systems_profiles.create
      summary: Create payment system profile
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Payment system profile object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        clients.payment_systems_profiles.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                clients_id:
                  type: integer
                  description: Client ID.
                payment_systems_configurations_id:
                  type: integer
                  description: Payment systems configuration ID.
                settings:
                  oneOf:
                  - type: object
                    properties:
                      card_ref:
                        type: string
                        description: Card reference.
                    required:
                    - card_ref
                    dependentRequired: {}
                    title: usaepay
                  - type: object
                    properties:
                      customer_profile_id:
                        type: string
                        description: Customer profile ID.
                    required:
                    - customer_profile_id
                    dependentRequired: {}
                    title: fluidpay
                  - type: object
                    properties:
                      customer_profile_id:
                        type: string
                        description: Customer profile ID.
                      payment_profile_id:
                        type: string
                        description: Payment profile ID.
                    required:
                    - customer_profile_id
                    - payment_profile_id
                    dependentRequired: {}
                    title: authorizenet
                  description: Profile settings.
              required:
              - clients_id
              - payment_systems_configurations_id
              dependentRequired: {}
    get:
      tags:
      - clients.payment_systems_profiles
      operationId: clients.payment_systems_profiles.search
      summary: List payment system profiles
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of payment system profile objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        clients.payment_systems_profiles.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - id
                    - -id
                    - payment_systems_name
                    - -payment_systems_name
                  default: []
                  description: List of columns to order results by.
                id:
                  type: array
                  items:
                    type: integer
                  description: Payment system profile ID.
                clients_id:
                  type: integer
                  description: Client ID.
                payment_systems_configurations_id:
                  type: integer
                  description: Payment system configuration ID.
              required: []
              dependentRequired: {}
  /clients/payment_systems_profiles/{id}:
    delete:
      tags:
      - clients.payment_systems_profiles
      operationId: clients.payment_systems_profiles.delete
      summary: Delete payment system profile
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Payment system profile ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        clients.payment_systems_profiles.delete

        :::


        '
    get:
      tags:
      - clients.payment_systems_profiles
      operationId: clients.payment_systems_profiles.get
      summary: Get payment system profile
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Payment system profile ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Payment system profile object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        clients.payment_systems_profiles.get

        :::


        '
    patch:
      tags:
      - clients.payment_systems_profiles
      operationId: clients.payment_systems_profiles.update
      summary: Update payment system profile
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Payment system profile ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        clients.payment_systems_profiles.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                clients_id:
                  type: integer
                  description: Client ID.
                payment_systems_configurations_id:
                  type: integer
                  description: Payment systems configuration ID.
                settings:
                  oneOf:
                  - type: object
                    properties:
                      card_ref:
                        type: string
                        description: Card reference.
                    required:
                    - card_ref
                    dependentRequired: {}
                    title: usaepay
                  - type: object
                    properties:
                      customer_profile_id:
                        type: string
                        description: Customer profile ID.
                    required:
                    - customer_profile_id
                    dependentRequired: {}
                    title: fluidpay
                  - type: object
                    properties:
                      customer_profile_id:
                        type: string
                        description: Customer profile ID.
                      payment_profile_id:
                        type: string
                        description: Payment profile ID.
                    required:
                    - customer_profile_id
                    - payment_profile_id
                    dependentRequired: {}
                    title: authorizenet
                  description: Profile settings.
              required:
              - clients_id
              - payment_systems_configurations_id
              dependentRequired: {}
  /clients/subscriptions/assign:
    post:
      tags:
      - clients.subscriptions
      operationId: clients.subscriptions.assign
      summary: Create subscription
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Subscription object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        clients.subscriptions.assign

        :::


        :::note

        The currencies of the package and client should match.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                clients_id:
                  type: integer
                  description: Client ID to assign package to.
                packages_id:
                  type: integer
                  description: Package ID.
                accounts_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Account ID. If not given the package is assigned to

                    the client itself.'
                start_dt:
                  type:
                  - string
                  - 'null'
                  format: date-time
                  default: now()
                  description: 'Timestamp when to activate package. If not given the

                    package will be activated at the current moment.'
                stop_dt:
                  type:
                  - string
                  - 'null'
                  format: date-time
                  default: null
                  description: Timestamp when to deactivate package.
                retro:
                  type: boolean
                  default: false
                  description: 'If `True` and the `start_dt` is in the past,  the
                    subscription

                    periods will be created retrospectively from `start_dt` till

                    the current moment. At the same time the charges will be also

                    created retrospectively from `start_dt` till the current moment.

                    If `False`, the subscription will be activated at the current
                    moment

                    and the charges will be dated according to the current time.'
                fees:
                  type:
                  - array
                  - 'null'
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                        - activation
                        - periodical
                        description: Type of the fee.
                      name:
                        type: string
                        description: Fee name. This is used to identify the fee in
                          the invoice line items.
                      rate:
                        type: number
                        format: decimal
                        description: Fee value.
                      default:
                        type: boolean
                        description: If `True`, the fee is marked as default. In common
                          scenario, the package has only default fees. The discounts,
                          if used, are applied to the default fee. Non-default fees
                          are used for special cases, when you need to outline multiple
                          fees as separate invoice line items.
                        default: false
                      note:
                        type:
                        - string
                        - 'null'
                        description: Fee note.
                        default: null
                      tags:
                        type: array
                        items:
                          type: string
                        description: Tag(s) for the fee. These are intended to be
                          used for determining tax that has to be applied to the fee.
                        default: []
                    required:
                    - type
                    - name
                    - rate
                    dependentRequired: {}
                  default: null
                  description: 'If given, the fees will be used instead of those defined
                    in

                    the package.'
                first_charging:
                  type: string
                  enum:
                  - pre_activation
                  - period_start
                  default: period_start
                  description: "Defines when the subscription fee is accounted:\n\
                    * `pre_activation` - the charges are dated at the end of the\n\
                    \    preceding period (e.g. for the period that starts on Oct\
                    \ 1st,\n    the charges will be dated on Sep 30th).\n* `period_start`\
                    \ - the charges are dated at the beginning of the\n    current\
                    \ period (e.g. for the period that starts on Oct 1st,\n    the\
                    \ charges will be dated on Oct 1st)."
                quantity:
                  type: integer
                  minimum: 1
                  maximum: 9999
                  default: 1
                  description: Quantity of the package instances to be assigned.
              required:
              - clients_id
              - packages_id
              dependentRequired: {}
  /clients/subscriptions/{id}:
    delete:
      tags:
      - clients.subscriptions
      operationId: clients.subscriptions.delete
      summary: Delete subscription
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Subscription ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        clients.subscriptions.delete

        :::


        '
    get:
      tags:
      - clients.subscriptions
      operationId: clients.subscriptions.get
      summary: Get subscription
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Subscription ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Subscription object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        clients.subscriptions.get

        :::


        '
    patch:
      tags:
      - clients.subscriptions
      operationId: clients.subscriptions.update
      summary: Update subscription
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Subscription ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Subscription details as stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        clients.subscriptions.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                stop_dt:
                  type:
                  - string
                  - 'null'
                  format: date-time
                  default: null
                  description: Timestamp at which the subscription should be closed.
                fees:
                  type:
                  - array
                  - 'null'
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                        - activation
                        - periodical
                        description: Type of the fee.
                      name:
                        type: string
                        description: Fee name. This is used to identify the fee in
                          the invoice line items.
                      rate:
                        type: number
                        format: decimal
                        description: Fee value.
                      default:
                        type: boolean
                        description: If `True`, the fee is marked as default. In common
                          scenario, the package has only default fees. The discounts,
                          if used, are applied to the default fee. Non-default fees
                          are used for special cases, when you need to outline multiple
                          fees as separate invoice line items.
                        default: false
                      note:
                        type:
                        - string
                        - 'null'
                        description: Fee note.
                        default: null
                      tags:
                        type: array
                        items:
                          type: string
                        description: Tag(s) for the fee. These are intended to be
                          used for determining tax that has to be applied to the fee.
                        default: []
                    required:
                    - type
                    - name
                    - rate
                    dependentRequired: {}
                  default: null
                  description: 'If given, the default fees defined for the subscription
                    will be

                    overridden with the provided list of fees.'
              required: []
              dependentRequired: {}
  /clients/subscriptions:
    get:
      tags:
      - clients.subscriptions
      operationId: clients.subscriptions.search
      summary: List subscriptions
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of subscription objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ":::note[JSON-RPC]\nclients.subscriptions.search\n:::\n\n:::info\
        \ Status vs Condition\n\nSubscription `status` represents current state of\
        \ the subscription.\nIt is calculated according to package `condition`, `start_dt`\
        \ and\n`stop_dt` of the package, and status of the last period.\n\nPossible\
        \ values:\n    * `active` \u2013 subscription is activated and there is an\
        \ active period\n        at the current moment.\n    * `pending` \u2013 subscription\
        \ is not activated or doesn't have an active\n        period at the current\
        \ moment, but still not deactivated.\n    * `archive` \u2013 subscription\
        \ is deactivated, `stop_dt` of the package\n        has passed or `renew_due`\
        \ is already in the past.\n\n:::"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - clients_name
                    - -clients_name
                    - id
                    - -id
                    - packages_name
                    - -packages_name
                    - periods_start_dt
                    - -periods_start_dt
                    - start_dt
                    - -start_dt
                    - status
                    - -status
                  default: []
                  description: List of columns to order results by.
                q:
                  type: string
                  description: Quick search (wildcards allowed).
                id:
                  type: array
                  items:
                    type: integer
                  description: Subscription ID.
                clients_id:
                  type: array
                  items:
                    type: integer
                  description: Client ID.
                accounts_id:
                  type: array
                  items:
                    type: integer
                  description: Account ID.
                packages_id:
                  type: array
                  items:
                    type: integer
                  description: Package ID.
                companies_id:
                  type: array
                  items:
                    type: integer
                  description: Partition ID of the client.
                owner_users_id:
                  type: integer
                  description: Owner user ID of the client.
                status:
                  type: array
                  items:
                    type: string
                    enum:
                    - pending
                    - active
                    - archive
                  description: Real status at the current moment.
                condition:
                  type: string
                  enum:
                  - new
                  - activated
                  - deactivated
                  description: 'Subscription condition. Check method description for

                    more details on the difference between `condition` and `status`.'
              required: []
              dependentRequired: {}
  /clients/subscriptions/periods:
    get:
      tags:
      - clients.subscriptions.periods
      operationId: clients.subscriptions.periods.search
      summary: List subscriptions periods
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of subscription period objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        clients.subscriptions.periods.search

        :::


        The method returns list of subscription periods including details on

        the entitled limits and their usage.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - id
                    - -id
                    - start_dt
                    - -start_dt
                    - stop_dt
                    - -stop_dt
                  default: []
                  description: List of columns to order results by.
                companies_id:
                  type: array
                  items:
                    type: integer
                  description: Partition ID of the client.
                clients_packages_id:
                  type: array
                  items:
                    type: integer
                  description: Subscription ID.
              required: []
              dependentRequired: {}
  /clients/templates:
    post:
      tags:
      - clients.templates
      operationId: clients.templates.create
      summary: Create client template
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Client template object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        clients.templates.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 255
                  description: Name.
                companies_id:
                  type: integer
                  description: Partition ID.
                credit:
                  type: number
                  format: decimal
                  minimum: -999999999.0
                  maximum: 999999999.0
                  description: 'Origination: allowed credit limit for prepaid clients.'
                tags:
                  type: array
                  items:
                    type: string
                  default: []
                  description: Tag(s).
                orig_rate_tables_ids:
                  type: array
                  items:
                    type: integer
                  default: []
                  description: 'Origination: rate table ID(s). If empty,

                    the rate tables of the accounts are used.'
                routing_plans_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Origination: routing plan ID. If not given, the

                    routing plans of the accounts are used.'
                orig_capacity:
                  type:
                  - integer
                  - 'null'
                  minimum: 0
                  maximum: 2147483647
                  default: null
                  description: 'Origination: concurrent channels capacity.'
                orig_low_balance_profiles_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Origination: low balance profile ID.'
                low_balance_capacity:
                  type:
                  - number
                  - 'null'
                  format: decimal
                  default: null
                  description: 'Origination: low balance threshold to enforce

                    capacity limitation.'
                low_balance_capacity_value:
                  type:
                  - integer
                  - 'null'
                  minimum: 0
                  maximum: 65535
                  default: null
                  description: 'Origination: capacity limit after

                    reaching low balance threshold.'
              required:
              - name
              - companies_id
              - credit
              dependentRequired: {}
    get:
      tags:
      - clients.templates
      operationId: clients.templates.search
      summary: List client templates
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of client objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        clients.templates.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - companies_name
                    - -companies_name
                    - credit
                    - -credit
                    - id
                    - -id
                    - name
                    - -name
                    - routing_plans_name
                    - -routing_plans_name
                  default: []
                  description: List of columns to order results by.
                q:
                  type: string
                  description: Quick search (wildcards allowed).
                id:
                  type: integer
                  description: Client template ID.
                name:
                  type: string
                  description: Name.
                companies_id:
                  type: array
                  items:
                    type: integer
                  description: Partition ID.
                orig_rate_tables_id:
                  type: array
                  items:
                    type: integer
                  description: Origination rate table ID.
                routing_plans_id:
                  type: integer
                  description: Routing plan ID.
              required: []
              dependentRequired: {}
  /clients/templates/{id}:
    delete:
      tags:
      - clients.templates
      operationId: clients.templates.delete
      summary: Delete client template
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Client template ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        clients.templates.delete

        :::


        Delete is possible only if the template hasn''t been used anywhere in

        the system (e.g. clients, partitions, etc.).'
    get:
      tags:
      - clients.templates
      operationId: clients.templates.get
      summary: Get client template
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Template ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Client template object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        clients.templates.get

        :::


        '
    patch:
      tags:
      - clients.templates
      operationId: clients.templates.update
      summary: Update client template
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Client template ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        clients.templates.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 255
                  description: Name.
                companies_id:
                  type: integer
                  description: Partition ID.
                credit:
                  type: number
                  format: decimal
                  minimum: -999999999.0
                  maximum: 999999999.0
                  description: 'Origination: allowed credit limit for prepaid clients.'
                tags:
                  type: array
                  items:
                    type: string
                  default: []
                  description: Tag(s).
                orig_rate_tables_ids:
                  type:
                  - array
                  - 'null'
                  items:
                    type: integer
                  default: null
                  description: 'Origination: rate table ID(s). If empty,

                    the rate tables of the accounts are used.'
                routing_plans_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Origination: routing plan ID. If not given, the

                    routing plans of the accounts are used.'
                orig_capacity:
                  type:
                  - integer
                  - 'null'
                  minimum: 0
                  maximum: 2147483647
                  default: null
                  description: 'Origination: concurrent channels capacity.'
                orig_low_balance_profiles_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Origination: low balance profile ID.'
                low_balance_capacity:
                  type:
                  - number
                  - 'null'
                  format: decimal
                  default: null
                  description: 'Origination: low balance threshold to enforce

                    capacity limitation.'
                low_balance_capacity_value:
                  type:
                  - integer
                  - 'null'
                  minimum: 0
                  maximum: 65535
                  default: null
                  description: 'Origination: capacity limit after

                    reaching low balance threshold.'
              required:
              - name
              - companies_id
              - credit
              dependentRequired: {}
  /companies/{id}:
    get:
      tags:
      - companies
      operationId: companies.get
      summary: Get partition
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Partition ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Partition object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        companies.get

        :::


        '
  /companies:
    get:
      tags:
      - companies
      operationId: companies.search
      summary: List partitions
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of partition objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        companies.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - balance
                    - -balance
                    - balance_accountant
                    - -balance_accountant
                    - balance_avail
                    - -balance_avail
                    - id
                    - -id
                    - name
                    - -name
                  default: []
                  description: List of columns to order results by.
                id:
                  type: array
                  items:
                    type: integer
                  description: Partition ID.
                name:
                  type: string
                  description: Name.
                status:
                  type: array
                  items:
                    type: string
                    enum:
                    - active
                    - deleted
                  description: Status.
                include_counts:
                  type: boolean
                  default: false
                  description: 'If `True`, include counts of the related entities

                    (users and clients) in the result.'
              required: []
              dependentRequired: {}
  /companies/legal_entities/{id}/archive:
    post:
      tags:
      - companies.legal_entities
      operationId: companies.legal_entities.archive
      summary: Archive legal entity
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Legal entity ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        companies.legal_entities.archive

        :::


        This should be the default action if you want to "remove" a legal entity.

        Full removal of the legal entity is dangerous and could be considered only

        if you are sure that there are no reference left (e.g. statistics, clients,

        etc).'
  /companies/legal_entities:
    post:
      tags:
      - companies.legal_entities
      operationId: companies.legal_entities.create
      summary: Create legal entity
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Legal entity object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        companies.legal_entities.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Name.
                companies_id:
                  type: integer
                  description: 'Partition ID. This field can not be changed once the

                    legal entity is created.'
                legal_name:
                  type: string
                  description: Legal name (used in the invoices for example).
                email:
                  type: string
                  format: email
                  description: Email.
                smtp_credentials_id:
                  type: integer
                  description: 'Credentials ID for SMTP server to send emails from

                    this legal entity (e.g. notifications, invoices, etc.).'
                invoices_number_template:
                  type: string
                  description: 'Invoice number template. Following

                    replacements are available:

                    * `%Y` - current year

                    * `%m` - current month

                    * `%d` - current day

                    * `%C` - client ID

                    * `%N` - client name

                    * `%x` - system-wide sequence invoice number

                    * `%X` - legal entity sequence invoice number'
                invoices_last_seq_number:
                  type: integer
                  description: Invoice sequence number.
                logo_files_id:
                  type: string
                  description: File ID of the logo.
                clients_templates_id:
                  type: integer
                  description: 'Client template ID to use for all clients of this

                    legal entity. Can be overridden for each client individually.'
                address:
                  type: string
                  description: 'Legal address: street address.'
                city:
                  type: string
                  description: 'Legal address: city.'
                zip_code:
                  type: string
                  description: 'Legal address: postal or ZIP code.'
                bank_account:
                  type: string
                  description: Bank account.
                tax_id:
                  type: string
                  description: Tax ID.
                reg_id:
                  type: string
                  description: Registration ID.
                peppol_endpoint_id:
                  type: string
                  description: 'PEPPOL invoicing: company electronic address.'
                peppol_endpoint_scheme_id:
                  type: string
                  description: 'PEPPOL invoicing: scheme code for electronic

                    address.'
                peppol_buyer_reference:
                  type: string
                  description: 'PEPPOL invoicing: reference provided by invoice

                    recipient.'
                status:
                  type: string
                  enum:
                  - active
                  - archive
                  default: active
                  description: Status.
                invoices_date_type:
                  type: string
                  enum:
                  - real_date
                  - end_date
                  default: real_date
                  description: "Invoice date type:\n* `real_date` - set invoice date\
                    \ to the real date when the invoice\n    was created.\n* `end_date`\
                    \ - set invoice date to the end date of the invoicing\n    period."
                country:
                  type:
                  - string
                  - 'null'
                  enum:
                  - AF
                  - AL
                  - DZ
                  - AS
                  - AD
                  - AO
                  - AI
                  - AQ
                  - AG
                  - AR
                  - AM
                  - AW
                  - AU
                  - AT
                  - AZ
                  - BS
                  - BH
                  - BD
                  - BB
                  - BY
                  - BE
                  - BZ
                  - BJ
                  - BM
                  - BT
                  - BO
                  - BQ
                  - BA
                  - BW
                  - BV
                  - BR
                  - IO
                  - BN
                  - BG
                  - BF
                  - BI
                  - CV
                  - KH
                  - CM
                  - CA
                  - KY
                  - CF
                  - TD
                  - CL
                  - CN
                  - CX
                  - CC
                  - CO
                  - KM
                  - CG
                  - CD
                  - CK
                  - CR
                  - HR
                  - CU
                  - CW
                  - CY
                  - CZ
                  - CI
                  - DK
                  - DJ
                  - DM
                  - DO
                  - EC
                  - EG
                  - SV
                  - GQ
                  - ER
                  - EE
                  - SZ
                  - ET
                  - FK
                  - FO
                  - FJ
                  - FI
                  - FR
                  - GF
                  - PF
                  - TF
                  - GA
                  - GM
                  - GE
                  - DE
                  - GH
                  - GI
                  - GR
                  - GL
                  - GD
                  - GP
                  - GU
                  - GT
                  - GG
                  - GN
                  - GW
                  - GY
                  - HT
                  - HM
                  - VA
                  - HN
                  - HK
                  - HU
                  - IS
                  - IN
                  - ID
                  - IR
                  - IQ
                  - IE
                  - IM
                  - IL
                  - IT
                  - JM
                  - JP
                  - JE
                  - JO
                  - KZ
                  - KE
                  - KI
                  - KP
                  - KR
                  - KW
                  - KG
                  - LA
                  - LV
                  - LB
                  - LS
                  - LR
                  - LY
                  - LI
                  - LT
                  - LU
                  - MO
                  - MG
                  - MW
                  - MY
                  - MV
                  - ML
                  - MT
                  - MH
                  - MQ
                  - MR
                  - MU
                  - YT
                  - MX
                  - FM
                  - MD
                  - MC
                  - MN
                  - ME
                  - MS
                  - MA
                  - MZ
                  - MM
                  - NA
                  - NR
                  - NP
                  - NL
                  - NC
                  - NZ
                  - NI
                  - NE
                  - NG
                  - NU
                  - NF
                  - MK
                  - MP
                  - 'NO'
                  - OM
                  - PK
                  - PW
                  - PS
                  - PA
                  - PG
                  - PY
                  - PE
                  - PH
                  - PN
                  - PL
                  - PT
                  - PR
                  - QA
                  - RO
                  - RU
                  - RW
                  - RE
                  - BL
                  - SH
                  - KN
                  - LC
                  - MF
                  - PM
                  - VC
                  - WS
                  - SM
                  - ST
                  - SA
                  - SN
                  - RS
                  - SC
                  - SL
                  - SG
                  - SX
                  - SK
                  - SI
                  - SB
                  - SO
                  - ZA
                  - GS
                  - SS
                  - ES
                  - LK
                  - SD
                  - SR
                  - SJ
                  - SE
                  - CH
                  - SY
                  - TW
                  - TJ
                  - TZ
                  - TH
                  - TL
                  - TG
                  - TK
                  - TO
                  - TT
                  - TN
                  - TM
                  - TC
                  - TV
                  - TR
                  - UG
                  - UA
                  - AE
                  - GB
                  - US
                  - UM
                  - UY
                  - UZ
                  - VU
                  - VE
                  - VN
                  - VG
                  - VI
                  - WF
                  - EH
                  - YE
                  - ZM
                  - ZW
                  - AX
                  default: null
                  description: 'Legal address: country (2-letter ISO code).'
                state:
                  type:
                  - string
                  - 'null'
                  enum:
                  - AL
                  - AK
                  - AZ
                  - AR
                  - CA
                  - CO
                  - CT
                  - DE
                  - FL
                  - GA
                  - HI
                  - ID
                  - IL
                  - IN
                  - IA
                  - KS
                  - KY
                  - LA
                  - ME
                  - MD
                  - MA
                  - MI
                  - MN
                  - MS
                  - MO
                  - MT
                  - NE
                  - NV
                  - NH
                  - NJ
                  - NM
                  - NY
                  - NC
                  - ND
                  - OH
                  - OK
                  - OR
                  - PA
                  - RI
                  - SC
                  - SD
                  - TN
                  - TX
                  - UT
                  - VT
                  - VA
                  - WA
                  - WV
                  - WI
                  - WY
                  default: null
                  description: 'Legal address: state (2-letter ANSI code, for the
                    US only).'
              required:
              - name
              - companies_id
              - legal_name
              - email
              - smtp_credentials_id
              - invoices_number_template
              - invoices_last_seq_number
              - logo_files_id
              - clients_templates_id
              - address
              - city
              - zip_code
              - bank_account
              - tax_id
              - reg_id
              - peppol_endpoint_id
              - peppol_endpoint_scheme_id
              - peppol_buyer_reference
              dependentRequired: {}
    get:
      tags:
      - companies.legal_entities
      operationId: companies.legal_entities.search
      summary: List legal entities
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of legal entity objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        companies.legal_entities.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - companies_name
                    - -companies_name
                    - id
                    - -id
                    - name
                    - -name
                    - status
                    - -status
                  default: []
                  description: List of columns to order results by.
                q:
                  type: string
                  description: Quick search (wildcards allowed).
                companies_id:
                  type: array
                  items:
                    type: integer
                  description: Partition ID.
                status:
                  type: array
                  items:
                    type: string
                    enum:
                    - active
                    - archive
                  description: Status.
              required: []
              dependentRequired: {}
  /companies/legal_entities/{id}:
    delete:
      tags:
      - companies.legal_entities
      operationId: companies.legal_entities.delete
      summary: Delete legal entity
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Legal entity ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        companies.legal_entities.delete

        :::


        Delete is possible only if the legal entity hasn''t been used anywhere in

        the system (e.g. invoices, clients, etc.).'
    get:
      tags:
      - companies.legal_entities
      operationId: companies.legal_entities.get
      summary: Get legal entity
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Legal entity ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Legal entity object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        companies.legal_entities.get

        :::


        '
    patch:
      tags:
      - companies.legal_entities
      operationId: companies.legal_entities.update
      summary: Update legal entity
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Legal entity ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        companies.legal_entities.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Name.
                legal_name:
                  type: string
                  description: Legal name (used in the invoices for example).
                email:
                  type: string
                  format: email
                  description: Email.
                smtp_credentials_id:
                  type: integer
                  description: 'Credentials ID for SMTP server to send emails from

                    this legal entity (e.g. notifications, invoices, etc.).'
                invoices_number_template:
                  type: string
                  description: 'Invoice number template. Following

                    replacements are available:

                    * `%Y` - current year

                    * `%m` - current month

                    * `%d` - current day

                    * `%C` - client ID

                    * `%N` - client name

                    * `%x` - system-wide sequence invoice number

                    * `%X` - legal entity sequence invoice number'
                invoices_last_seq_number:
                  type: integer
                  description: Invoice sequence number.
                logo_files_id:
                  type: string
                  description: File ID of the logo.
                clients_templates_id:
                  type: integer
                  description: 'Client template ID to use for all clients of this

                    legal entity. Can be overridden for each client individually.'
                address:
                  type: string
                  description: 'Legal address: street address.'
                city:
                  type: string
                  description: 'Legal address: city.'
                zip_code:
                  type: string
                  description: 'Legal address: postal or ZIP code.'
                bank_account:
                  type: string
                  description: Bank account.
                tax_id:
                  type: string
                  description: Tax ID.
                reg_id:
                  type: string
                  description: Registration ID.
                peppol_endpoint_id:
                  type: string
                  description: 'PEPPOL invoicing: company electronic address.'
                peppol_endpoint_scheme_id:
                  type: string
                  description: 'PEPPOL invoicing: scheme code for electronic

                    address.'
                peppol_buyer_reference:
                  type: string
                  description: 'PEPPOL invoicing: reference provided by invoice

                    recipient.'
                status:
                  type: string
                  enum:
                  - active
                  - archive
                  default: active
                  description: Status.
                invoices_date_type:
                  type: string
                  enum:
                  - real_date
                  - end_date
                  default: real_date
                  description: "Invoice date type:\n* `real_date` - set invoice date\
                    \ to the real date when the invoice\n    was created.\n* `end_date`\
                    \ - set invoice date to the end date of the invoicing\n    period."
                country:
                  type:
                  - string
                  - 'null'
                  enum:
                  - AF
                  - AL
                  - DZ
                  - AS
                  - AD
                  - AO
                  - AI
                  - AQ
                  - AG
                  - AR
                  - AM
                  - AW
                  - AU
                  - AT
                  - AZ
                  - BS
                  - BH
                  - BD
                  - BB
                  - BY
                  - BE
                  - BZ
                  - BJ
                  - BM
                  - BT
                  - BO
                  - BQ
                  - BA
                  - BW
                  - BV
                  - BR
                  - IO
                  - BN
                  - BG
                  - BF
                  - BI
                  - CV
                  - KH
                  - CM
                  - CA
                  - KY
                  - CF
                  - TD
                  - CL
                  - CN
                  - CX
                  - CC
                  - CO
                  - KM
                  - CG
                  - CD
                  - CK
                  - CR
                  - HR
                  - CU
                  - CW
                  - CY
                  - CZ
                  - CI
                  - DK
                  - DJ
                  - DM
                  - DO
                  - EC
                  - EG
                  - SV
                  - GQ
                  - ER
                  - EE
                  - SZ
                  - ET
                  - FK
                  - FO
                  - FJ
                  - FI
                  - FR
                  - GF
                  - PF
                  - TF
                  - GA
                  - GM
                  - GE
                  - DE
                  - GH
                  - GI
                  - GR
                  - GL
                  - GD
                  - GP
                  - GU
                  - GT
                  - GG
                  - GN
                  - GW
                  - GY
                  - HT
                  - HM
                  - VA
                  - HN
                  - HK
                  - HU
                  - IS
                  - IN
                  - ID
                  - IR
                  - IQ
                  - IE
                  - IM
                  - IL
                  - IT
                  - JM
                  - JP
                  - JE
                  - JO
                  - KZ
                  - KE
                  - KI
                  - KP
                  - KR
                  - KW
                  - KG
                  - LA
                  - LV
                  - LB
                  - LS
                  - LR
                  - LY
                  - LI
                  - LT
                  - LU
                  - MO
                  - MG
                  - MW
                  - MY
                  - MV
                  - ML
                  - MT
                  - MH
                  - MQ
                  - MR
                  - MU
                  - YT
                  - MX
                  - FM
                  - MD
                  - MC
                  - MN
                  - ME
                  - MS
                  - MA
                  - MZ
                  - MM
                  - NA
                  - NR
                  - NP
                  - NL
                  - NC
                  - NZ
                  - NI
                  - NE
                  - NG
                  - NU
                  - NF
                  - MK
                  - MP
                  - 'NO'
                  - OM
                  - PK
                  - PW
                  - PS
                  - PA
                  - PG
                  - PY
                  - PE
                  - PH
                  - PN
                  - PL
                  - PT
                  - PR
                  - QA
                  - RO
                  - RU
                  - RW
                  - RE
                  - BL
                  - SH
                  - KN
                  - LC
                  - MF
                  - PM
                  - VC
                  - WS
                  - SM
                  - ST
                  - SA
                  - SN
                  - RS
                  - SC
                  - SL
                  - SG
                  - SX
                  - SK
                  - SI
                  - SB
                  - SO
                  - ZA
                  - GS
                  - SS
                  - ES
                  - LK
                  - SD
                  - SR
                  - SJ
                  - SE
                  - CH
                  - SY
                  - TW
                  - TJ
                  - TZ
                  - TH
                  - TL
                  - TG
                  - TK
                  - TO
                  - TT
                  - TN
                  - TM
                  - TC
                  - TV
                  - TR
                  - UG
                  - UA
                  - AE
                  - GB
                  - US
                  - UM
                  - UY
                  - UZ
                  - VU
                  - VE
                  - VN
                  - VG
                  - VI
                  - WF
                  - EH
                  - YE
                  - ZM
                  - ZW
                  - AX
                  default: null
                  description: 'Legal address: country (2-letter ISO code).'
                state:
                  type:
                  - string
                  - 'null'
                  enum:
                  - AL
                  - AK
                  - AZ
                  - AR
                  - CA
                  - CO
                  - CT
                  - DE
                  - FL
                  - GA
                  - HI
                  - ID
                  - IL
                  - IN
                  - IA
                  - KS
                  - KY
                  - LA
                  - ME
                  - MD
                  - MA
                  - MI
                  - MN
                  - MS
                  - MO
                  - MT
                  - NE
                  - NV
                  - NH
                  - NJ
                  - NM
                  - NY
                  - NC
                  - ND
                  - OH
                  - OK
                  - OR
                  - PA
                  - RI
                  - SC
                  - SD
                  - TN
                  - TX
                  - UT
                  - VT
                  - VA
                  - WA
                  - WV
                  - WI
                  - WY
                  default: null
                  description: 'Legal address: state (2-letter ANSI code, for the
                    US only).'
              required:
              - name
              - legal_name
              - email
              - smtp_credentials_id
              - invoices_number_template
              - invoices_last_seq_number
              - logo_files_id
              - clients_templates_id
              - address
              - city
              - zip_code
              - bank_account
              - tax_id
              - reg_id
              - peppol_endpoint_id
              - peppol_endpoint_scheme_id
              - peppol_buyer_reference
              dependentRequired: {}
  /companies/legal_entities/payment_systems_configurations:
    post:
      tags:
      - companies.legal_entities.payment_systems_configurations
      operationId: companies.legal_entities.payment_systems_configurations.create
      summary: Create configuration
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Payment system configuration object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        companies.legal_entities.payment_systems_configurations.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                legal_entities_id:
                  type: integer
                  description: Legal entity ID.
                payment_systems_id:
                  type: string
                  description: Payment system ID.
                currencies_id:
                  type: integer
                  description: Currency ID.
                payment_accounts_id:
                  type: integer
                  description: Payment account ID.
                settings:
                  oneOf:
                  - type: object
                    properties:
                      api_key:
                        type: string
                        description: API key.
                      api_pin:
                        type: string
                        description: API PIN.
                    required:
                    - api_key
                    - api_pin
                    dependentRequired: {}
                    title: usaepay
                  - type: object
                    properties:
                      api_key:
                        type: string
                        description: API key.
                      currency_code:
                        type: string
                        enum:
                        - USD
                        - EUR
                        description: Currency code.
                    required:
                    - api_key
                    - currency_code
                    dependentRequired: {}
                    title: fluidpay
                  - type: object
                    properties:
                      api_login_id:
                        type: string
                        description: API login ID.
                      transaction_key:
                        type: string
                        description: Transaction key.
                      currency_code:
                        type: string
                        enum:
                        - USD
                        - EUR
                        - CAD
                        description: Currency code.
                    required:
                    - api_login_id
                    - transaction_key
                    - currency_code
                    dependentRequired: {}
                    title: authorizenet
                  description: Integration settings.
              required:
              - legal_entities_id
              - payment_systems_id
              - currencies_id
              - payment_accounts_id
              dependentRequired: {}
    get:
      tags:
      - companies.legal_entities.payment_systems_configurations
      operationId: companies.legal_entities.payment_systems_configurations.search
      summary: List configurations
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of payment system configuration objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        companies.legal_entities.payment_systems_configurations.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - id
                    - -id
                  default: []
                  description: List of columns to order results by.
                id:
                  type: array
                  items:
                    type: integer
                  description: Payment system configuration ID.
                legal_entities_id:
                  type: array
                  items:
                    type: integer
                  description: Legal entity ID.
                payment_systems_id:
                  type: string
                  description: Payment system ID.
              required: []
              dependentRequired: {}
  /companies/legal_entities/payment_systems_configurations/{id}:
    get:
      tags:
      - companies.legal_entities.payment_systems_configurations
      operationId: companies.legal_entities.payment_systems_configurations.get
      summary: Get configuration
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Payment system configuration ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Payment system configuration object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        companies.legal_entities.payment_systems_configurations.get

        :::


        '
    patch:
      tags:
      - companies.legal_entities.payment_systems_configurations
      operationId: companies.legal_entities.payment_systems_configurations.update
      summary: Update configuration
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Payment system configuration ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        companies.legal_entities.payment_systems_configurations.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                legal_entities_id:
                  type: integer
                  description: Legal entity ID.
                payment_systems_id:
                  type: string
                  description: Payment system ID.
                currencies_id:
                  type: integer
                  description: Currency ID.
                payment_accounts_id:
                  type: integer
                  description: Payment account ID.
                settings:
                  oneOf:
                  - type: object
                    properties:
                      api_key:
                        type: string
                        description: API key.
                      api_pin:
                        type: string
                        description: API PIN.
                    required:
                    - api_key
                    - api_pin
                    dependentRequired: {}
                    title: usaepay
                  - type: object
                    properties:
                      api_key:
                        type: string
                        description: API key.
                      currency_code:
                        type: string
                        enum:
                        - USD
                        - EUR
                        description: Currency code.
                    required:
                    - api_key
                    - currency_code
                    dependentRequired: {}
                    title: fluidpay
                  - type: object
                    properties:
                      api_login_id:
                        type: string
                        description: API login ID.
                      transaction_key:
                        type: string
                        description: Transaction key.
                      currency_code:
                        type: string
                        enum:
                        - USD
                        - EUR
                        - CAD
                        description: Currency code.
                    required:
                    - api_login_id
                    - transaction_key
                    - currency_code
                    dependentRequired: {}
                    title: authorizenet
                  description: Integration settings.
              required:
              - legal_entities_id
              - payment_systems_id
              - currencies_id
              - payment_accounts_id
              dependentRequired: {}
  /configuration/codes:
    post:
      tags:
      - configuration.codes
      operationId: configuration.codes.create
      summary: Create code
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Code object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        configuration.codes.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                code_decks_id:
                  type: integer
                  description: Code deck ID.
                code:
                  type: string
                  description: Code.
                name:
                  type: string
                  description: Code name.
                country:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Code country.
              required:
              - code_decks_id
              - code
              - name
              dependentRequired: {}
    delete:
      tags:
      - configuration.codes
      operationId: configuration.codes.delete
      summary: Delete code
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        configuration.codes.delete

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                code_decks_id:
                  type: integer
                  description: Code deck ID.
                code:
                  type: string
                  description: Code.
              required:
              - code_decks_id
              - code
              dependentRequired: {}
    get:
      tags:
      - configuration.codes
      operationId: configuration.codes.search
      summary: List codes
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of code objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        configuration.codes.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - code
                    - -code
                    - country
                    - -country
                    - name
                    - -name
                  default: []
                  description: List of columns to order results by.
                q:
                  type: string
                  description: Quick search (wildcards allowed).
                code_decks_id:
                  type: integer
                  description: Code deck ID.
                code:
                  type: string
                  description: Code (wildcards allowed).
                name:
                  type: string
                  description: Name (wildcards allowed).
              required: []
              dependentRequired: {}
    patch:
      tags:
      - configuration.codes
      operationId: configuration.codes.update
      summary: Update code
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        configuration.codes.update

        :::


        :::info

        All parameters except `code_decks_id` and `code` are optional, only

        provided parameters will be updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                code_decks_id:
                  type: integer
                  description: Code deck ID.
                code:
                  type: string
                  description: Code.
                name:
                  type: string
                  description: Code name.
                country:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Code country.
              required:
              - code_decks_id
              - code
              - name
              dependentRequired: {}
  /configuration/codes/decks:
    post:
      tags:
      - configuration.codes.decks
      operationId: configuration.codes.decks.create
      summary: Create code deck
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Code deck object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        configuration.codes.decks.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 255
                  description: Name.
                companies_id:
                  type: integer
                  description: 'Partition ID. Null value means that the code deck
                    is

                    available for all partitions. It can be used only by the API users

                    without partition restriction.'
              required:
              - name
              - companies_id
              dependentRequired: {}
    get:
      tags:
      - configuration.codes.decks
      operationId: configuration.codes.decks.search
      summary: List code decks
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of code deck objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        configuration.codes.decks.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - companies_name
                    - -companies_name
                    - count
                    - -count
                    - id
                    - -id
                    - name
                    - -name
                  default: []
                  description: List of columns to order results by.
                q:
                  type: string
                  description: Quick search (wildcards allowed).
                id:
                  type: integer
                  description: Code deck ID.
                companies_id:
                  type: array
                  items:
                    type: integer
                  description: Partition ID.
                name:
                  type: string
                  description: Name.
                include_count:
                  type: boolean
                  description: If `True`, codes count will be included in the result.
              required: []
              dependentRequired: {}
  /configuration/codes/decks/{id}:
    delete:
      tags:
      - configuration.codes.decks
      operationId: configuration.codes.decks.delete
      summary: Delete code deck
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Code deck ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        configuration.codes.decks.delete

        :::


        Delete is possible only if the code deck hasn''t been used anywhere in

        the system (e.g. packages, rate tables, etc.).'
    get:
      tags:
      - configuration.codes.decks
      operationId: configuration.codes.decks.get
      summary: Get code deck
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Code deck ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Code deck object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        configuration.codes.decks.get

        :::


        '
    patch:
      tags:
      - configuration.codes.decks
      operationId: configuration.codes.decks.update
      summary: Update code deck
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Code deck ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        configuration.codes.decks.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 255
                  description: Name.
                companies_id:
                  type: integer
                  description: 'Partition ID. Null value means that the code deck
                    is

                    available for all partitions. It can be used only by the API users

                    without partition restriction.'
              required:
              - name
              - companies_id
              dependentRequired: {}
  /configuration/low_balance_profiles:
    post:
      tags:
      - configuration.low_balance_profiles
      operationId: configuration.low_balance_profiles.create
      summary: Create profile
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Low balance profile object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        configuration.low_balance_profiles.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 64
                  description: Name.
                companies_id:
                  type: integer
                  description: Partition ID.
                currencies_id:
                  type: integer
                  description: Currency ID.
                period:
                  type: integer
                  minimum: 1
                  default: 24
                  description: 'How often to perform balance check and send notifications.

                    Given in hours.'
                notify_max_qty:
                  type: integer
                  minimum: 1
                  default: 7
                  description: 'Maximum number of notifications to be sent under each

                    particular rule.'
                sort:
                  type: integer
                  minimum: -2147483647
                  maximum: 2147483647
                  default: 100
                  description: Sort order (used for options sorting in the UI).
                client:
                  type:
                  - object
                  - 'null'
                  properties:
                    threshold:
                      type: number
                      format: decimal
                      description: Balance threshold.
                    notify_emails:
                      type: array
                      items:
                        type: string
                        format: email
                      description: Additional email(s) to notify. Client billing email
                        is included automatically.
                      default: []
                  required:
                  - threshold
                  dependentRequired: {}
                  default: null
                  description: Rule definition for the client notification.
                client_adv:
                  type:
                  - object
                  - 'null'
                  properties:
                    threshold:
                      type: number
                      format: decimal
                      description: Balance threshold.
                    min_inactivity_period:
                      type: integer
                      minimum: 1
                      description: Minimum period of client inactivity. The notification
                        will be sent only if the client has not been charged for any
                        service for given amount of days, which implies that customer
                        has stopped using the services.
                    notify_emails:
                      type: array
                      items:
                        type: string
                        format: email
                      description: Additional email(s) to notify. Client billing email
                        is included automatically.
                      default: []
                  required:
                  - threshold
                  - min_inactivity_period
                  dependentRequired: {}
                  default: null
                  description: Advanced rule definition for the client notification.
                user:
                  type:
                  - object
                  - 'null'
                  properties:
                    threshold:
                      type: number
                      format: decimal
                      description: Balance threshold.
                    notify:
                      type: boolean
                      description: If `True`, user defined as an owner of the client
                        will be notified via email defined in the user profile.
                      default: false
                    notify_emails:
                      type: array
                      items:
                        type: string
                        format: email
                      description: Additional email(s) to notify.
                      default: []
                    notify_users_ids:
                      type: array
                      items:
                        type:
                        - integer
                        - 'null'
                        default: null
                      description: User ID(s) to notify. The notification will be
                        sent to the user via email defined in the user profile.
                      default: []
                  required:
                  - threshold
                  dependentRequired: {}
                  default: null
                  description: Rule definition for the system user notification.
              required:
              - name
              - companies_id
              - currencies_id
              dependentRequired: {}
    get:
      tags:
      - configuration.low_balance_profiles
      operationId: configuration.low_balance_profiles.search
      summary: List profiles
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of low balance profile objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        configuration.low_balance_profiles.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - id
                    - -id
                    - name
                    - -name
                    - sort
                    - -sort
                  default: []
                  description: List of columns to order results by.
                q:
                  type: string
                  description: Quick search (wildcards allowed).
                id:
                  type: array
                  items:
                    type: integer
                  description: Low balance profile ID.
                name:
                  type: string
                  description: Name.
                companies_id:
                  type: array
                  items:
                    type: integer
                  description: Partition ID.
              required: []
              dependentRequired: {}
  /configuration/low_balance_profiles/{id}:
    delete:
      tags:
      - configuration.low_balance_profiles
      operationId: configuration.low_balance_profiles.delete
      summary: Delete profile
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Low balance profile ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        configuration.low_balance_profiles.delete

        :::


        '
    get:
      tags:
      - configuration.low_balance_profiles
      operationId: configuration.low_balance_profiles.get
      summary: Get profile
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Low balance profile ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Low balance profile object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        configuration.low_balance_profiles.get

        :::


        '
    patch:
      tags:
      - configuration.low_balance_profiles
      operationId: configuration.low_balance_profiles.update
      summary: Update profile
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Low balance profile ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        configuration.low_balance_profiles.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 64
                  description: Name.
                companies_id:
                  type: integer
                  description: Partition ID.
                currencies_id:
                  type: integer
                  description: Currency ID.
                period:
                  type: integer
                  minimum: 1
                  default: 24
                  description: 'How often to perform balance check and send notifications.

                    Given in hours.'
                notify_max_qty:
                  type: integer
                  minimum: 1
                  default: 7
                  description: 'Maximum number of notifications to be sent under each

                    particular rule.'
                sort:
                  type: integer
                  minimum: -2147483647
                  maximum: 2147483647
                  default: 100
                  description: Sort order (used for options sorting in the UI).
                client:
                  type:
                  - object
                  - 'null'
                  properties:
                    threshold:
                      type: number
                      format: decimal
                      description: Balance threshold.
                    notify_emails:
                      type: array
                      items:
                        type: string
                        format: email
                      description: Additional email(s) to notify. Client billing email
                        is included automatically.
                      default: []
                  required:
                  - threshold
                  dependentRequired: {}
                  default: null
                  description: Rule definition for the client notification.
                client_adv:
                  type:
                  - object
                  - 'null'
                  properties:
                    threshold:
                      type: number
                      format: decimal
                      description: Balance threshold.
                    min_inactivity_period:
                      type: integer
                      minimum: 1
                      description: Minimum period of client inactivity. The notification
                        will be sent only if the client has not been charged for any
                        service for given amount of days, which implies that customer
                        has stopped using the services.
                    notify_emails:
                      type: array
                      items:
                        type: string
                        format: email
                      description: Additional email(s) to notify. Client billing email
                        is included automatically.
                      default: []
                  required:
                  - threshold
                  - min_inactivity_period
                  dependentRequired: {}
                  default: null
                  description: Advanced rule definition for the client notification.
                user:
                  type:
                  - object
                  - 'null'
                  properties:
                    threshold:
                      type: number
                      format: decimal
                      description: Balance threshold.
                    notify:
                      type: boolean
                      description: If `True`, user defined as an owner of the client
                        will be notified via email defined in the user profile.
                      default: false
                    notify_emails:
                      type: array
                      items:
                        type: string
                        format: email
                      description: Additional email(s) to notify.
                      default: []
                    notify_users_ids:
                      type: array
                      items:
                        type:
                        - integer
                        - 'null'
                        default: null
                      description: User ID(s) to notify. The notification will be
                        sent to the user via email defined in the user profile.
                      default: []
                  required:
                  - threshold
                  dependentRequired: {}
                  default: null
                  description: Rule definition for the system user notification.
              required:
              - name
              - companies_id
              - currencies_id
              dependentRequired: {}
  /configuration/quantities:
    get:
      tags:
      - configuration.quantities
      operationId: configuration.quantities.search
      summary: List quantities
      parameters:
      - in: query
        name: id
        schema:
          type: string
        description: Quantity ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of quantity objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        configuration.quantities.search

        :::


        '
  /configuration/services:
    post:
      tags:
      - configuration.services
      operationId: configuration.services.create
      summary: Create service
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Service object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        configuration.services.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 128
                  description: Name.
                quantities_id:
                  type: string
                  description: Quantity ID.
                rating_units_id:
                  type: string
                  description: Unit ID for volume presentation in rates and packages.
                rating_params_units_id:
                  type: string
                  description: 'Unit ID for rate details ("Interval", "Min Volume",

                    "Grace Volume").'
                reports_units_id:
                  type: string
                  description: Unit ID for volume presentation in aggregated reports.
                reports_detailed_units_id:
                  type: string
                  description: Unit ID for volume presentation in xDR reports.
                code:
                  type:
                  - string
                  - 'null'
                  maxLength: 128
                  default: null
                  description: Identification code.
                precision_volume:
                  type: integer
                  minimum: 0
                  maximum: 128
                  default: 4
                  description: 'Precision (number of decimal places) used for volume

                    formatting.'
                sort:
                  type: integer
                  minimum: -2147483647
                  maximum: 2147483647
                  default: 100
                  description: Sort order (used for options sorting in the UI).
              required:
              - name
              - quantities_id
              - rating_units_id
              - rating_params_units_id
              - reports_units_id
              - reports_detailed_units_id
              dependentRequired: {}
    get:
      tags:
      - configuration.services
      operationId: configuration.services.search
      summary: List services
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of service objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        configuration.services.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - code
                    - -code
                    - id
                    - -id
                    - name
                    - -name
                    - quantities_id
                    - -quantities_id
                    - rating_params_units_id
                    - -rating_params_units_id
                    - rating_units_id
                    - -rating_units_id
                    - reports_detailed_units_id
                    - -reports_detailed_units_id
                    - reports_units_id
                    - -reports_units_id
                    - sort
                    - -sort
                  default: []
                  description: List of columns to order results by.
                id:
                  type: integer
                  description: Service ID.
                name:
                  type: string
                  description: Name.
                code:
                  type: string
                  description: Identification code.
                quantities_id:
                  type: string
                  description: Quantity ID.
              required: []
              dependentRequired: {}
  /configuration/services/{id}:
    delete:
      tags:
      - configuration.services
      operationId: configuration.services.delete
      summary: Delete service
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: System service ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        configuration.services.delete

        :::


        '
    get:
      tags:
      - configuration.services
      operationId: configuration.services.get
      summary: Get service
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Service ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Service object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        configuration.services.get

        :::


        '
    patch:
      tags:
      - configuration.services
      operationId: configuration.services.update
      summary: Update service
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Service ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        configuration.services.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 128
                  description: Name.
                quantities_id:
                  type: string
                  description: Quantity ID.
                rating_units_id:
                  type: string
                  description: Unit ID for volume presentation in rates and packages.
                rating_params_units_id:
                  type: string
                  description: 'Unit ID for rate details ("Interval", "Min Volume",

                    "Grace Volume").'
                reports_units_id:
                  type: string
                  description: Unit ID for volume presentation in aggregated reports.
                reports_detailed_units_id:
                  type: string
                  description: Unit ID for volume presentation in xDR reports.
                code:
                  type:
                  - string
                  - 'null'
                  maxLength: 128
                  default: null
                  description: Identification code.
                precision_volume:
                  type: integer
                  minimum: 0
                  maximum: 128
                  default: 4
                  description: 'Precision (number of decimal places) used for volume

                    formatting.'
                sort:
                  type: integer
                  minimum: -2147483647
                  maximum: 2147483647
                  default: 100
                  description: Sort order (used for options sorting in the UI).
              required:
              - name
              - quantities_id
              - rating_units_id
              - rating_params_units_id
              - reports_units_id
              - reports_detailed_units_id
              dependentRequired: {}
  /configuration/tags/{id}:
    delete:
      tags:
      - configuration.tags
      operationId: configuration.tags.delete
      summary: Delete tag
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Tag ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        configuration.tags.delete

        :::


        '
  /configuration/tags:
    get:
      tags:
      - configuration.tags
      operationId: configuration.tags.search
      summary: List tags
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of tag objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        configuration.tags.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - name
                    - -name
                  default: []
                  description: List of columns to order results by.
                q:
                  type: string
                  description: Quick search (wildcards allowed).
                id:
                  type: array
                  items:
                    type: integer
                  description: Tag ID.
                companies_id:
                  type: array
                  items:
                    type: integer
                  description: Partition ID.
                name:
                  type: string
                  description: Name.
              required: []
              dependentRequired: {}
  /configuration/time_profiles:
    post:
      tags:
      - configuration.time_profiles
      operationId: configuration.time_profiles.create
      summary: Create time profile
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Time profile object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        configuration.time_profiles.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 32
                  description: Name.
                wd:
                  type: array
                  items:
                    type: string
                    enum:
                    - su
                    - mo
                    - tu
                    - we
                    - th
                    - fr
                    - sa
                  default: []
                  description: List of weekdays included.
                hours:
                  type: array
                  items:
                    type: integer
                    enum:
                    - 0
                    - 1
                    - 2
                    - 3
                    - 4
                    - 5
                    - 6
                    - 7
                    - 8
                    - 9
                    - 10
                    - 11
                    - 12
                    - 13
                    - 14
                    - 15
                    - 16
                    - 17
                    - 18
                    - 19
                    - 20
                    - 21
                    - 22
                    - 23
                  default: []
                  description: 'List of hours included (for example value `[11, 12]`
                    will

                    include an interval from 11:00 till 12:59). In 24h format.'
                sort:
                  type: integer
                  minimum: -2147483647
                  maximum: 2147483647
                  default: 100
                  description: Sort order (used for options sorting in the UI).
              required:
              - name
              dependentRequired: {}
    get:
      tags:
      - configuration.time_profiles
      operationId: configuration.time_profiles.search
      summary: List time profiles
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of time profile objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        configuration.time_profiles.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - hours
                    - -hours
                    - id
                    - -id
                    - name
                    - -name
                    - sort
                    - -sort
                    - wd
                    - -wd
                  default: []
                  description: List of columns to order results by.
                q:
                  type: string
                  description: Quick search (wildcards allowed).
                id:
                  type: array
                  items:
                    type: integer
                  description: Time profile ID.
                name:
                  type: string
                  description: Name.
                in_time_profile:
                  type: string
                  format: date-time
                  description: 'If provided, the result will include only time

                    profiles that match given datetime.'
              required: []
              dependentRequired: {}
  /configuration/time_profiles/{id}:
    delete:
      tags:
      - configuration.time_profiles
      operationId: configuration.time_profiles.delete
      summary: Delete time profile
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Time profile ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        configuration.time_profiles.delete

        :::


        '
    get:
      tags:
      - configuration.time_profiles
      operationId: configuration.time_profiles.get
      summary: Get time profile
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Time profile ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Time profile object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        configuration.time_profiles.get

        :::


        '
    patch:
      tags:
      - configuration.time_profiles
      operationId: configuration.time_profiles.update
      summary: Update time profile
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Time profile ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        configuration.time_profiles.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 32
                  description: Name.
                wd:
                  type: array
                  items:
                    type: string
                    enum:
                    - su
                    - mo
                    - tu
                    - we
                    - th
                    - fr
                    - sa
                  default: []
                  description: List of weekdays included.
                hours:
                  type: array
                  items:
                    type: integer
                    enum:
                    - 0
                    - 1
                    - 2
                    - 3
                    - 4
                    - 5
                    - 6
                    - 7
                    - 8
                    - 9
                    - 10
                    - 11
                    - 12
                    - 13
                    - 14
                    - 15
                    - 16
                    - 17
                    - 18
                    - 19
                    - 20
                    - 21
                    - 22
                    - 23
                  default: []
                  description: 'List of hours included (for example value `[11, 12]`
                    will

                    include an interval from 11:00 till 12:59). In 24h format.'
                sort:
                  type: integer
                  minimum: -2147483647
                  maximum: 2147483647
                  default: 100
                  description: Sort order (used for options sorting in the UI).
              required:
              - name
              dependentRequired: {}
  /configuration/units:
    get:
      tags:
      - configuration.units
      operationId: configuration.units.search
      summary: List units
      parameters:
      - in: query
        name: id
        schema:
          type: string
        description: Units ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of unit objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        configuration.units.search

        :::


        '
  /custom_fields:
    post:
      tags:
      - custom_fields
      operationId: custom_fields.create
      summary: Create definition
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Custom field definition object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        custom_fields.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                companies_id:
                  type: integer
                  description: Partition ID.
                object_type:
                  type: string
                  enum:
                  - clients
                  - packages
                  - dids
                  description: Object type.
                key:
                  type: string
                  description: Field key, short "slug" to be used via API.
                title:
                  type: string
                  description: Field title, human-readable.
                value_type:
                  type: string
                  enum:
                  - string
                  - decimal
                  - integer
                  - datetime
                  default: string
                  description: Field value type.
                validation_string_regex:
                  type:
                  - string
                  - 'null'
                  format: regex
                  default: null
                  description: 'POSIX regular expression that values should match.

                    For string fields only.'
                order:
                  type: integer
                  minimum: -32768
                  maximum: 32767
                  default: 1
                  description: Sort order (used for ordering options in the UI).
              required:
              - companies_id
              - object_type
              - key
              - title
              dependentRequired: {}
    get:
      tags:
      - custom_fields
      operationId: custom_fields.search
      summary: List definitions
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of custom field definition objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        custom_fields.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - id
                    - -id
                    - order
                    - -order
                  default: []
                  description: List of columns to order results by.
                id:
                  type: array
                  items:
                    type: integer
                  description: Custom field definition ID.
                companies_id:
                  type: array
                  items:
                    type: integer
                  description: Partition ID.
                object_type:
                  type: string
                  enum:
                  - clients
                  - packages
                  - dids
                  description: Object type.
              required: []
              dependentRequired: {}
  /custom_fields/{id}:
    delete:
      tags:
      - custom_fields
      operationId: custom_fields.delete
      summary: Delete definition
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Custom field definition ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        custom_fields.delete

        :::


        '
    get:
      tags:
      - custom_fields
      operationId: custom_fields.get
      summary: Get definition
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Custom field definition ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Custom field definition object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        custom_fields.get

        :::


        '
    patch:
      tags:
      - custom_fields
      operationId: custom_fields.update
      summary: Update definition
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Custom field ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        custom_fields.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                companies_id:
                  type: integer
                  description: Partition ID.
                object_type:
                  type: string
                  enum:
                  - clients
                  - packages
                  - dids
                  description: Object type.
                key:
                  type: string
                  description: Field key, short "slug" to be used via API.
                title:
                  type: string
                  description: Field title, human-readable.
                value_type:
                  type: string
                  enum:
                  - string
                  - decimal
                  - integer
                  - datetime
                  default: string
                  description: Field value type.
                validation_string_regex:
                  type:
                  - string
                  - 'null'
                  format: regex
                  default: null
                  description: 'POSIX regular expression that values should match.

                    For string fields only.'
                order:
                  type: integer
                  minimum: -32768
                  maximum: 32767
                  default: 1
                  description: Sort order (used for ordering options in the UI).
              required:
              - companies_id
              - object_type
              - key
              - title
              dependentRequired: {}
  /dids/{id}/activate:
    post:
      tags:
      - dids
      operationId: dids.activate
      summary: Activate DID
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: DID ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        dids.activate

        :::


        The method moves DID to the `active` status. If you activate DID which is

        on hold or blocked, you may omit subscription ID and account ID. In all other

        cases they are required.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                clients_packages_id:
                  type: integer
                  description: Subscription ID under which the DID is assigned.
                accounts_id:
                  type: integer
                  description: Account ID to link DID to.
              required:
              - clients_packages_id
              - accounts_id
              dependentRequired: {}
  /dids/{id}/archive:
    post:
      tags:
      - dids
      operationId: dids.archive
      summary: Archive DID
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: DID ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        dids.archive

        :::


        Move DID to `archive` status. DID can be moved to this status from any

        other status. Relation to an account, subscription and hold duration

        will be reset in this case.'
  /dids/{id}/block:
    post:
      tags:
      - dids
      operationId: dids.block
      summary: Block DID
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: DID ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        dids.block

        :::


        The method moves DID to the `blocked` status. Only active or on hold DIDs

        can be blocked.'
  /dids:
    post:
      tags:
      - dids
      operationId: dids.create
      summary: Create DID
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: DID object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        dids.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                operators_id:
                  type: integer
                  description: Operator ID.
                did:
                  type: string
                  minLength: 1
                  maxLength: 32
                  description: DID number.
                tag:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Tag (for definition of DID entitlement within the packages).
                status:
                  type: string
                  enum:
                  - reserved
                  - instock
                  - archive
                  default: reserved
                  description: Status.
                hold_next_status:
                  type: string
                  enum:
                  - reserved
                  - instock
                  - archive
                  default: instock
                  description: 'Status to which DID is transitioned after the

                    hold period.'
                notes:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Notes.
              required:
              - operators_id
              - did
              dependentRequired: {}
    get:
      tags:
      - dids
      operationId: dids.search
      summary: List DIDs
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of DID objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        dids.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - clients_name
                    - -clients_name
                    - did
                    - -did
                    - id
                    - -id
                    - notes
                    - -notes
                    - status
                    - -status
                    - tag
                    - -tag
                  default: []
                  description: List of columns to order results by.
                q:
                  type: string
                  description: Quick search (wildcards allowed).
                id:
                  type: array
                  items:
                    type: integer
                  description: DID ID.
                companies_id:
                  type: array
                  items:
                    type: integer
                  description: Partition ID.
                did:
                  type: array
                  items:
                    type: string
                  description: DID number.
                status:
                  type: array
                  items:
                    type: string
                    enum:
                    - reserved
                    - instock
                    - active
                    - blocked
                    - hold
                    - archive
                  description: Status.
                clients_id:
                  type: array
                  items:
                    type: integer
                  description: Client ID to which DID is assigned.
                accounts_id:
                  type: array
                  items:
                    type: integer
                  description: Account ID to which DID is assigned.
                clients_packages_id:
                  type: array
                  items:
                    type: integer
                  description: Subscription ID to which DID is assigned.
                operators_id:
                  type: array
                  items:
                    type: integer
                  description: Operator ID.
                tags_any:
                  type: array
                  items:
                    type: string
                  description: Tag, uses "match any" logic.
              required: []
              dependentRequired: {}
  /dids/{id}:
    delete:
      tags:
      - dids
      operationId: dids.delete
      summary: Delete DID
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: DID ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        dids.delete

        :::


        '
    get:
      tags:
      - dids
      operationId: dids.get
      summary: Get DID
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: DID ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: DID object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        dids.get

        :::


        '
    patch:
      tags:
      - dids
      operationId: dids.update
      summary: Update DID
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: DID ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        dids.update

        :::


        It is not allowed to update `status` via this method. Please use dedicated

        methods for transition to the new status, since each of the status may

        have different requirements.


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                operators_id:
                  type: integer
                  description: Operator ID.
                did:
                  type: string
                  minLength: 1
                  maxLength: 32
                  description: DID number.
                tag:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Tag (for definition of DID entitlement within the packages).
                hold_next_status:
                  type: string
                  enum:
                  - reserved
                  - instock
                  - archive
                  default: instock
                  description: 'Status to which DID is transitioned after the

                    hold period.'
                notes:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Notes.
              required:
              - operators_id
              - did
              dependentRequired: {}
  /dids/{id}/hold:
    post:
      tags:
      - dids
      operationId: dids.hold
      summary: Hold DID
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: DID ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        dids.hold

        :::


        The method moves DID to the `hold` status. Only active or blocked DIDs can

        be put on hold. After specified amount of hold days pass DID will be moved

        back to the status defined in the `status_after_hold` field of the DID.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                hold_days:
                  type: integer
                  minimum: 0
                  description: Number of days to keep DID on hold for.
              required:
              - hold_days
              dependentRequired: {}
  /dids/{id}/reserve:
    post:
      tags:
      - dids
      operationId: dids.reserve
      summary: Reserve DID
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: DID ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        dids.reserve

        :::


        The method moves DID to the `reserved` status. Any DID can be moved to

        this status. Relation to an account, subscription and hold duration are

        reset if they were set by the previous status.'
  /dids/{id}/stock:
    post:
      tags:
      - dids
      operationId: dids.stock
      summary: Stock DID
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: DID ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        dids.stock

        :::


        The method moves DID to the `instock` status. Any DID can be moved to

        this status. Relation to an account, subscription ID and hold duration are

        reset if they were set by the previous status.'
  /dids/custom_fields/{id}:
    get:
      tags:
      - dids.custom_fields
      operationId: dids.custom_fields.get
      summary: Get custom fields
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: DID ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Custom fields object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        dids.custom_fields.get

        :::


        '
    patch:
      tags:
      - dids.custom_fields
      operationId: dids.custom_fields.update
      summary: Update custom fields
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: DID ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        dids.custom_fields.update

        :::


        The method allows extra fields to be provided according to the

        the custom fields definition. The name of the field should be

        equal to the `key` of the custom field definition.'
  /dids/operators:
    post:
      tags:
      - dids.operators
      operationId: dids.operators.create
      summary: Create operator
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: DID operator object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        dids.operators.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 0
                  maxLength: 255
                  description: Name.
                companies_id:
                  type: integer
                  description: Partition ID.
              required:
              - name
              - companies_id
              dependentRequired: {}
    get:
      tags:
      - dids.operators
      operationId: dids.operators.search
      summary: List operators
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of DID operator objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        dids.operators.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - id
                    - -id
                    - name
                    - -name
                    - num_dids
                    - -num_dids
                  default: []
                  description: List of columns to order results by.
                q:
                  type: string
                  description: Quick search (wildcards allowed).
                id:
                  type: array
                  items:
                    type: integer
                  description: DID operator ID.
                companies_id:
                  type: array
                  items:
                    type: integer
                  description: Partition ID.
                include_count:
                  type: boolean
                  default: false
                  description: 'If `True`, result will include counts of DIDs assigned
                    to

                    the operator. Use with caution as counts may significantly slow
                    down

                    the request.'
                name:
                  type: string
                  description: Name.
              required: []
              dependentRequired: {}
  /dids/operators/{id}:
    delete:
      tags:
      - dids.operators
      operationId: dids.operators.delete
      summary: Delete operator
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: DID operator ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        dids.operators.delete

        :::


        '
    get:
      tags:
      - dids.operators
      operationId: dids.operators.get
      summary: Get operator
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: DID operator ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: DID operator object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        dids.operators.get

        :::


        '
    patch:
      tags:
      - dids.operators
      operationId: dids.operators.update
      summary: Update operator
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Operator ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        dids.operators.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 0
                  maxLength: 255
                  description: Name.
                companies_id:
                  type: integer
                  description: Partition ID.
              required:
              - name
              - companies_id
              dependentRequired: {}
  /iam/whoami:
    get:
      tags:
      - iam
      operationId: iam.whoami
      summary: Who am I?
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: 'Object containing user details, default module, permissions,

            and preferences.'
          content:
            application/json:
              schema:
                type: object
      description: ":::note[JSON-RPC]\niam.whoami\n:::\n\nThe method returns information\
        \ about currently authorized user:\n\n    * general user details\n    * default\
        \ module to load\n    * permissions\n    * localization settings\n    * system\
        \ version (temporary)"
  /iam/auth/jwt/authenticate:
    post:
      tags:
      - iam.auth.jwt
      operationId: iam.auth.jwt.authenticate
      summary: Create JWT by login/password
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Object containing JWT and its metadata.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        iam.auth.jwt.authenticate

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                login:
                  type: string
                  description: User login.
                password:
                  type: string
                  description: User password.
              required:
              - login
              - password
              dependentRequired: {}
  /iam/auth/jwt/refresh:
    post:
      tags:
      - iam.auth.jwt
      operationId: iam.auth.jwt.refresh
      summary: Refresh JWT
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Object containing JWT and its metadata.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        iam.auth.jwt.refresh

        :::


        '
  /iam/profile/password:
    post:
      tags:
      - iam.profile
      operationId: iam.profile.update_password
      summary: Change password
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        iam.profile.update_password

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                old:
                  type: string
                  description: Old password.
                new:
                  type: string
                  description: New password.
              required:
              - old
              - new
              dependentRequired: {}
  /iam/profile/preferences:
    put:
      tags:
      - iam.profile
      operationId: iam.profile.update_preferences
      summary: Update preferences
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        iam.profile.update_preferences

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                locale:
                  type: string
                  description: Preferred locale.
                timezone:
                  type: string
                  format: timezone
                  description: Preferred timezone.
              required: []
              dependentRequired: {}
  /iam/roles:
    post:
      tags:
      - iam.roles
      operationId: iam.roles.create
      summary: Create role
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Role object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        iam.roles.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 64
                  description: Name.
                default_module:
                  type: string
                  maxLength: 64
                  description: Module opened by default on sign in.
                entries:
                  type: object
                  default: {}
                  description: 'An object defining permissions allowed for each of
                    the

                    system module. Should be given in a format of an associative

                    array (JSON object), where key is module name and value is a list

                    of allowed ACLs.'
              required:
              - name
              - default_module
              dependentRequired: {}
    get:
      tags:
      - iam.roles
      operationId: iam.roles.search
      summary: List roles
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of role objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        iam.roles.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - id
                    - -id
                    - name
                    - -name
                  default: []
                  description: List of columns to order results by.
                q:
                  type: string
                  description: Quick search (wildcards allowed).
                id:
                  type: integer
                  description: Role ID.
              required: []
              dependentRequired: {}
  /iam/roles/{id}:
    delete:
      tags:
      - iam.roles
      operationId: iam.roles.delete
      summary: Delete role
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Role ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        iam.roles.delete

        :::


        '
    get:
      tags:
      - iam.roles
      operationId: iam.roles.get
      summary: Get role
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Role ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Role object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        iam.roles.get

        :::


        '
    patch:
      tags:
      - iam.roles
      operationId: iam.roles.update
      summary: Update role
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Role ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        iam.roles.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 64
                  description: Name.
                default_module:
                  type: string
                  maxLength: 64
                  description: Module opened by default on sign in.
                entries:
                  type: object
                  default: {}
                  description: 'An object defining permissions allowed for each of
                    the

                    system module. Should be given in a format of an associative

                    array (JSON object), where key is module name and value is a list

                    of allowed ACLs.'
              required:
              - name
              - default_module
              dependentRequired: {}
  /iam/users/{id}/archive:
    post:
      tags:
      - iam.users
      operationId: iam.users.archive
      summary: Archive user
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: User ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Numbers of the object ownership transfers per each entity type.
          content:
            application/json:
              schema:
                type: object
      description: ":::note[JSON-RPC]\niam.users.archive\n:::\n\nSince user may own\
        \ some other entities within a system, it is possible to\ndefine a new owner\
        \ for the entities owned by the user to be archived.\n\nIf the new owner is\
        \ specified, the ownership of the following entities will\nbe transferred:\n\
        \    * Clients\n    * Rate tables\n    * Stored queries\n\nIf the new owner\
        \ is not specified:\n    1. Report Queries owned by the user will be deleted.\n\
        \    2. User should not own any active clients or rate tables.\n\nIn both\
        \ cases all temporary entities (like one-time stored report queries)\nwill\
        \ be fully removed.\n\nIn addition, the user will be removed as a recipient\
        \ of:\n    * Stored report queries to email\n    * Stored report queries monitoring\n\
        \    * Low balance monitoring"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                new_owner_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'New owner for the entities owned by the user to be

                    archived. The user should be active and belong to the same

                    partition or both of them should not be limited by partition.'
              required: []
              dependentRequired: {}
  /iam/users:
    post:
      tags:
      - iam.users
      operationId: iam.users.create
      summary: Create user
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: User object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        iam.users.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                login:
                  type: string
                  minLength: 1
                  maxLength: 32
                  description: Login.
                password:
                  type: string
                  description: Password.
                roles_id:
                  type: integer
                  description: Role ID.
                companies_id:
                  type: integer
                  description: 'Partition ID. Null value means that the user doesn''t

                    belong to any partition. It can be used only by the API users

                    without partition restriction.'
                fullname:
                  type: string
                  maxLength: 128
                  description: Full name.
                supervisor:
                  type: boolean
                  default: false
                  description: 'If `True`, the user is a supervisor and allowed to
                    access

                    clients and rate tables that are owned by any other user of the

                    same partition.'
                status:
                  type: string
                  enum:
                  - active
                  - blocked
                  - archive
                  default: active
                  description: Status.
                allowed_ips:
                  type:
                  - array
                  - 'null'
                  items:
                    type: string
                    format: cidr
                  default: null
                  description: 'List of allowed IP addresses. If not given, the user
                    is

                    allowed from any IP.'
                email:
                  type:
                  - string
                  - 'null'
                  format: email
                  default: null
                  description: Email address.
                locale:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Preferred locale. If not given, system default will
                    be used.
                timezone:
                  type:
                  - string
                  - 'null'
                  format: timezone
                  default: null
                  description: Preferred timezone. If not given, system default will
                    be used.
              required:
              - login
              - password
              - roles_id
              - companies_id
              - fullname
              dependentRequired: {}
    get:
      tags:
      - iam.users
      operationId: iam.users.search
      summary: List users
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of user objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        iam.users.search

        :::


        :::note

        If the user account making an API request is limited by a partition

        and is not a supervisor, the method will return empty list.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - companies_name
                    - -companies_name
                    - fullname
                    - -fullname
                    - login
                    - -login
                    - roles_name
                    - -roles_name
                    - status
                    - -status
                  default: []
                  description: List of columns to order results by.
                q:
                  type: string
                  description: Quick search (wildcards allowed).
                id:
                  type: array
                  items:
                    type: integer
                  description: User ID.
                companies_id:
                  type: array
                  items:
                    type: integer
                  description: Partition ID.
                company_limited_only:
                  type: boolean
                  description: 'If `True`, only users limited by a partition

                    will be returned.'
                login:
                  type: string
                  description: Login.
                password:
                  type: string
                  description: Password.
                token:
                  type: string
                  description: API key.
                roles_id:
                  type: integer
                  description: Role ID.
                status:
                  type: array
                  items:
                    type: string
                    enum:
                    - active
                    - blocked
                    - archive
                  description: Status.
              required: []
              dependentRequired: {}
  /iam/users/{id}:
    get:
      tags:
      - iam.users
      operationId: iam.users.get
      summary: Get user
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: User ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: User object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        iam.users.get

        :::


        '
    patch:
      tags:
      - iam.users
      operationId: iam.users.update
      summary: Update user
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: User ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        iam.users.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                login:
                  type: string
                  minLength: 1
                  maxLength: 32
                  description: Login.
                roles_id:
                  type: integer
                  description: Role ID.
                companies_id:
                  type: integer
                  description: 'Partition ID. Null value means that the user doesn''t

                    belong to any partition. It can be used only by the API users

                    without partition restriction.'
                fullname:
                  type: string
                  maxLength: 128
                  description: Full name.
                password:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Password.
                supervisor:
                  type: boolean
                  default: false
                  description: 'If `True`, the user is a supervisor and allowed to
                    access

                    clients and rate tables that are owned by any other user of the

                    same partition.'
                status:
                  type: string
                  enum:
                  - active
                  - blocked
                  - archive
                  default: active
                  description: Status.
                allowed_ips:
                  type:
                  - array
                  - 'null'
                  items:
                    type: string
                    format: cidr
                  default: null
                  description: 'List of allowed IP addresses. If not given, the user
                    is

                    allowed from any IP.'
                email:
                  type:
                  - string
                  - 'null'
                  format: email
                  default: null
                  description: Email address.
                locale:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Preferred locale. If not given, system default will
                    be used.
                timezone:
                  type:
                  - string
                  - 'null'
                  format: timezone
                  default: null
                  description: Preferred timezone. If not given, system default will
                    be used.
              required:
              - login
              - roles_id
              - companies_id
              - fullname
              dependentRequired: {}
  /integration/credentials:
    post:
      tags:
      - integration.credentials
      operationId: integration.credentials.create
      summary: Create credentials
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Credentials object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        integration.credentials.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                companies_id:
                  type: integer
                  description: Partition ID.
                name:
                  type: string
                  description: Name.
                type:
                  type: string
                  enum:
                  - ftp
                  - ssh
                  - sftp
                  - imap
                  - imap_microsoft
                  - web
                  - smtp
                  description: Connection type.
                login:
                  type:
                  - string
                  - 'null'
                  maxLength: 255
                  default: null
                  description: 'Username.

                    Required if type is `ftp`, `ssh`, `imap` or `web`.'
                password:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Password.

                    Required if type is `ftp`, `imap` or `web`.

                    Additionally required for type `smtp` if `login` is provided.'
                host:
                  type:
                  - string
                  - 'null'
                  maxLength: 255
                  default: null
                  description: 'Server hostname or IP address.

                    Required if type is `ftp`, `ssh`, `imap` or `smtp`.'
                port:
                  type:
                  - integer
                  - 'null'
                  minimum: 1
                  maximum: 65535
                  default: null
                  description: 'Server port.

                    Required if type is `ftp`, `ssh`, `imap` or `smtp`.'
                smtp_security:
                  type:
                  - string
                  - 'null'
                  enum:
                  - plain
                  - tls
                  - ssl
                  default: null
                  description: 'SMTP security mode.

                    Required if type is `smtp`.'
                imap_microsoft_settings:
                  type: object
                  properties:
                    client_id:
                      type: string
                      description: Microsoft client ID.
                    tenant:
                      type: string
                      description: Tenant name.
                    refresh_token:
                      type: string
                      description: Refresh token.
                  required:
                  - client_id
                  - tenant
                  - refresh_token
                  dependentRequired: {}
                  default: {}
                  description: 'Microsoft IMAP settings.

                    Required if type is `imap_microsoft`.'
              required:
              - companies_id
              - name
              - type
              dependentRequired: {}
    get:
      tags:
      - integration.credentials
      operationId: integration.credentials.search
      summary: List credentials
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of credentials objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        integration.credentials.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - host
                    - -host
                    - id
                    - -id
                    - name
                    - -name
                    - type
                    - -type
                  default: []
                  description: List of columns to order results by.
                q:
                  type: string
                  description: Quick search (wildcards allowed).
                id:
                  type: array
                  items:
                    type: integer
                  description: Credential ID.
                companies_id:
                  type: array
                  items:
                    type: integer
                  description: Partition ID.
                type:
                  type: array
                  items:
                    type: string
                    enum:
                    - ftp
                    - ssh
                    - sftp
                    - imap
                    - imap_microsoft
                    - web
                    - smtp
                  description: Connection type.
              required: []
              dependentRequired: {}
  /integration/credentials/{id}:
    delete:
      tags:
      - integration.credentials
      operationId: integration.credentials.delete
      summary: Delete credentials
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Credentials ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        integration.credentials.delete

        :::


        Delete is possible only if the credentials haven''t been used anywhere in

        the system (e.g. equipment, legal entities, etc.).'
    get:
      tags:
      - integration.credentials
      operationId: integration.credentials.get
      summary: Get credentials
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Credentials ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Credentials object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        integration.credentials.get

        :::


        '
    patch:
      tags:
      - integration.credentials
      operationId: integration.credentials.update
      summary: Update credentials
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Credentials ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        integration.credentials.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.


        Please note, that on type change - all non-related fields will be reset.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                companies_id:
                  type: integer
                  description: Partition ID.
                name:
                  type: string
                  description: Name.
                type:
                  type: string
                  enum:
                  - ftp
                  - ssh
                  - sftp
                  - imap
                  - imap_microsoft
                  - web
                  - smtp
                  description: Connection type.
                login:
                  type:
                  - string
                  - 'null'
                  maxLength: 255
                  default: null
                  description: 'Username.

                    Required if type is `ftp`, `ssh`, `imap` or `web`.'
                password:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Password.

                    Required if type is `ftp`, `imap` or `web`.

                    Additionally required for type `smtp` if `login` is provided.'
                host:
                  type:
                  - string
                  - 'null'
                  maxLength: 255
                  default: null
                  description: 'Server hostname or IP address.

                    Required if type is `ftp`, `ssh`, `imap` or `smtp`.'
                port:
                  type:
                  - integer
                  - 'null'
                  minimum: 1
                  maximum: 65535
                  default: null
                  description: 'Server port.

                    Required if type is `ftp`, `ssh`, `imap` or `smtp`.'
                smtp_security:
                  type:
                  - string
                  - 'null'
                  enum:
                  - plain
                  - tls
                  - ssl
                  default: null
                  description: 'SMTP security mode.

                    Required if type is `smtp`.'
                imap_microsoft_settings:
                  type: object
                  properties:
                    client_id:
                      type: string
                      description: Microsoft client ID.
                    tenant:
                      type: string
                      description: Tenant name.
                    refresh_token:
                      type: string
                      description: Refresh token.
                  required:
                  - client_id
                  - tenant
                  - refresh_token
                  dependentRequired: {}
                  default: {}
                  description: 'Microsoft IMAP settings.

                    Required if type is `imap_microsoft`.'
              required:
              - companies_id
              - name
              - type
              dependentRequired: {}
  /integration/download_logs/{id}:
    delete:
      tags:
      - integration.download_logs
      operationId: integration.download_logs.delete
      summary: Delete log entry
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Download log entry ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        integration.download_logs.delete

        :::


        '
    get:
      tags:
      - integration.download_logs
      operationId: integration.download_logs.get
      summary: Get log entry
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Download log entry ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Download log entry object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        integration.download_logs.get

        :::


        '
  /integration/download_logs:
    get:
      tags:
      - integration.download_logs
      operationId: integration.download_logs.search
      summary: List log entries
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of download log entry objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        integration.download_logs.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - dl_dt
                    - -dl_dt
                    - filename
                    - -filename
                    - filesize
                    - -filesize
                    - id
                    - -id
                    - source_name
                    - -source_name
                  default: []
                  description: List of columns to order results by.
                q:
                  type: string
                  description: Quick search (wildcards allowed).
                filename:
                  type: string
                  description: Filename.
                equipment_id:
                  type: integer
                  description: Equipment ID (for files downloaded from equipment).
                lnp_gateways_id:
                  type: integer
                  description: 'Number portability gateway ID (for files downloaded

                    from number portability gateways).'
                source:
                  type: string
                  enum:
                  - equipment
                  - lnp_gateways
                  description: Source type.
              required: []
              dependentRequired: {}
  /integration/equipment/{id}/archive:
    post:
      tags:
      - integration.equipment
      operationId: integration.equipment.archive
      summary: Archive equipment
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Equipment ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        integration.equipment.archive

        :::


        '
  /integration/equipment:
    post:
      tags:
      - integration.equipment
      operationId: integration.equipment.create
      summary: Create equipment
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Equipment object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        integration.equipment.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 0
                  maxLength: 128
                  description: Name.
                services_id:
                  type: integer
                  description: Service ID.
                ip_address:
                  type:
                  - string
                  - 'null'
                  format: ipv4
                  default: null
                  description: 'Equipment IP address. Required when either `radius`

                    or `sip` flags are `True`.'
                companies_id:
                  type: array
                  items:
                    type: integer
                  default: []
                  description: Partition IDs that are allowed to use this equipment.
                tag:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Tag that will be added to events from this equipment.
                    It can be

                    used to filter events by equipment while within reports, invoices,

                    traffic rules, etc.'
                ident_priority:
                  type: array
                  items:
                    type: string
                    enum:
                    - ani
                    - name
                    - ip
                  default:
                  - ip
                  - name
                  - ani
                  description: 'List of the identification methods in the order of

                    their priority to be used for the events from this equipment.'
                ident_ani_orig_field:
                  type: string
                  enum:
                  - dst_party_id_ext
                  - src_party_id_ext
                  - src_party_id
                  - dst_party_id_bill
                  - src_party_id_bill
                  - dst_party_id
                  default: src_party_id
                  description: 'Which party ID to be used for the originating

                    events.'
                ident_ani_term_field:
                  type: string
                  enum:
                  - dst_party_id_ext
                  - src_party_id_ext
                  - src_party_id
                  - dst_party_id_bill
                  - src_party_id_bill
                  - dst_party_id
                  default: dst_party_id
                  description: 'Which party ID to be used for the terminating

                    events.'
                rate_orig_party_id:
                  type: boolean
                  default: true
                  description: 'If `True`, the originating events will be rated

                    by `src_party_id_in` mapped field, which is usually the one that

                    contains party ID in the way it has been received from the

                    customer. Otherwise the rating is done by `src_party_id_bill`,

                    which is available only for specific equipment types and contains

                    the party ID pre-processed by the equipment for billing purposes.'
                rate_term_party_id:
                  type: boolean
                  default: true
                  description: 'If `True`, the terminating events will be rated

                    by `dst_party_id_in` mapped field, which is usually the one that

                    contains party ID in the way it has been received from the

                    customer. Otherwise the rating is done by `dst_party_id_bill`,

                    which is available only for specific equipment types and contains

                    the party ID pre-processed by the equipment for billing purposes.'
                credentials_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: Credentials ID for the "Files Downloader" service.
                remote_settings:
                  oneOf:
                  - type: object
                    properties:
                      email_sender:
                        type:
                        - string
                        - 'null'
                        maxLength: 256
                        default: null
                      email_subject:
                        type:
                        - string
                        - 'null'
                        maxLength: 256
                        format: regex
                        default: null
                    required: []
                    dependentRequired: {}
                    title: imap
                  - type: object
                    properties:
                      path:
                        type: string
                    required:
                    - path
                    dependentRequired: {}
                    title: ftp
                  - type: object
                    properties: {}
                    required: []
                    dependentRequired: {}
                    title: 'null'
                  - type: object
                    properties:
                      path:
                        type: string
                    required:
                    - path
                    dependentRequired: {}
                    title: sftp
                  - type: object
                    properties:
                      path:
                        type: string
                    required:
                    - path
                    dependentRequired: {}
                    title: ssh
                  description: 'Additional settings for the "Files Downloader" service,

                    required fields according to chosen credentials.'
                fxdrs:
                  type: boolean
                  default: false
                  description: 'If `True`, the "Files Collector" service will be enabled
                    for

                    this equipment.'
                fxdrs_collectors_id:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Collector ID for the "Files Collector" service.

                    Required when `fxdrs` is `True`.'
                fxdrs_units_id:
                  type:
                  - string
                  - 'null'
                  maxLength: 5
                  default: null
                  description: 'Units ID for the "Files Collector" service.

                    Required when `fxdrs` is `True`.'
                fxdrs_skip_zero_calls:
                  type: boolean
                  default: false
                  description: 'If `True`, the events with zero volume (duration)

                    will be skipped during processing.'
                fxdrs_skip_released_calls:
                  type: boolean
                  default: false
                  description: 'If `True`, the events with "released" status

                    will be skipped during processing.'
                fxdrs_tz:
                  oneOf:
                  - default: sys
                    enum:
                    - sys
                    type: string
                  - format: timezone
                    type: string
                  type:
                  - 'null'
                  default: null
                  description: 'If defined, given timezone will override the timezone
                    of the

                    timestamp fields in the xDR files.'
                radius:
                  type: boolean
                  default: false
                  description: 'If `True`, the "RADIUS Server" service will be enabled
                    for

                    this equipment.'
                radius_collectors_id:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Collector ID for the "RADIUS Server" service.

                    Required when `radius` is `True`.'
                radius_secret:
                  type:
                  - string
                  - 'null'
                  maxLength: 128
                  default: null
                  description: 'RADIUS secret shared with the RADIUS server. Required

                    when `radius` is `True`.'
                radius_units_id:
                  type:
                  - string
                  - 'null'
                  maxLength: 5
                  default: null
                  description: 'Units ID for the "RADIUS Server" service.

                    Required when `radius` is `True`.'
                radius_active_calls:
                  type: boolean
                  default: false
                  description: 'If `True`, the "RADIUS Server" will track active

                    sessions. This produces additional load on the system and requires

                    more server resources. Use only if you need to track active sessions

                    or capacities.'
                radius_skip_zero_calls:
                  type: boolean
                  default: false
                  description: 'If `True`, the events with zero volume (duration)

                    will be skipped during processing.'
                radius_skip_released_calls:
                  type: boolean
                  default: false
                  description: 'If `True`, the events with "released" status

                    will be skipped during processing.'
                radius_save_xdrs:
                  type: boolean
                  default: true
                  description: 'If `True`, the "RADIUS Server" will produce xDR records

                    from the accounting stop packets. Typically this option should
                    be

                    set to `True`, unless you want to process accounting only by the

                    xDR files.'
                radius_write_xdrs:
                  type: boolean
                  default: false
                  description: 'If `True`, the "RADIUS Server" will write accounting

                    data into the internal xDR files, which allow reprocessing of

                    accounting data later if equipment doesn''t write its own xDR
                    files.

                    This option affects disk space used and performance of the RADIUS

                    server.'
                radius_tz:
                  oneOf:
                  - default: sys
                    enum:
                    - sys
                    type: string
                  - format: timezone
                    type: string
                  type:
                  - 'null'
                  default: null
                  description: 'If defined, given timezone will override the timezone
                    of the

                    timestamp fields in the RADIUS packets.'
                sip:
                  type: boolean
                  default: false
                  description: 'If `True`, the "SIP Server" service will be enabled
                    for this

                    equipment.'
                sip_collectors_id:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Collector ID for the "SIP Server" service.

                    Required when `sip` is `True`.'
                ac:
                  type: boolean
                  default: false
                  description: 'If `True`, the "AC Manager" service will be enabled
                    for this

                    equipment.'
                ac_collectors_id:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Collector ID for the "AC Manager" service.

                    Required when `ac` is `True`.'
                ac_credentials_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Credentials ID for the "AC Manager" service.

                    Required when `ac` is `True`.'
                ac_tz:
                  oneOf:
                  - default: sys
                    enum:
                    - sys
                    type: string
                  - format: timezone
                    type: string
                  type:
                  - 'null'
                  default: null
                  description: 'If defined, given timezone will override the timezone
                    of the

                    timestamp fields in the AC Manager packets.'
              required:
              - name
              - services_id
              dependentRequired: {}
    get:
      tags:
      - integration.equipment
      operationId: integration.equipment.search
      summary: List equipment
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of equipment objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        integration.equipment.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - ac
                    - -ac
                    - fxdrs
                    - -fxdrs
                    - fxdrs_queue
                    - -fxdrs_queue
                    - id
                    - -id
                    - name
                    - -name
                    - radius
                    - -radius
                    - sip
                    - -sip
                    - status
                    - -status
                  default: []
                  description: List of columns to order results by.
                q:
                  type: string
                  description: Quick search (wildcards allowed).
                id:
                  type: array
                  items:
                    type: integer
                  description: Equipment ID.
                companies_id:
                  type: array
                  items:
                    type: integer
                  description: Partition ID that is allowed to use equipment.
                status:
                  type: string
                  enum:
                  - archive
                  - active
                  description: Status.
                name:
                  type: string
                  description: Name.
                fxdrs:
                  type: boolean
                  description: If `True`, returns only equipment with "Files Collector"
                    enabled.
              required: []
              dependentRequired: {}
  /integration/equipment/{id}:
    get:
      tags:
      - integration.equipment
      operationId: integration.equipment.get
      summary: Get equipment
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Equipment ID.
      - in: query
        name: active_only
        schema:
          type: boolean
          default: false
        description: If `True`, only return equipment with an active status.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Equipment object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        integration.equipment.get

        :::


        '
    patch:
      tags:
      - integration.equipment
      operationId: integration.equipment.update
      summary: Update equipment
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Equipment ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        integration.equipment.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 0
                  maxLength: 128
                  description: Name.
                services_id:
                  type: integer
                  description: Service ID.
                status:
                  type: string
                  enum:
                  - archive
                  - active
                  description: Status.
                ip_address:
                  type:
                  - string
                  - 'null'
                  format: ipv4
                  default: null
                  description: 'Equipment IP address. Required when either `radius`

                    or `sip` flags are `True`.'
                companies_id:
                  type: array
                  items:
                    type: integer
                  default: []
                  description: Partition IDs that are allowed to use this equipment.
                tag:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Tag that will be added to events from this equipment.
                    It can be

                    used to filter events by equipment while within reports, invoices,

                    traffic rules, etc.'
                ident_priority:
                  type: array
                  items:
                    type: string
                    enum:
                    - ani
                    - name
                    - ip
                  default:
                  - ip
                  - name
                  - ani
                  description: 'List of the identification methods in the order of

                    their priority to be used for the events from this equipment.'
                ident_ani_orig_field:
                  type: string
                  enum:
                  - dst_party_id_ext
                  - src_party_id_ext
                  - src_party_id
                  - dst_party_id_bill
                  - src_party_id_bill
                  - dst_party_id
                  default: src_party_id
                  description: 'Which party ID to be used for the originating

                    events.'
                ident_ani_term_field:
                  type: string
                  enum:
                  - dst_party_id_ext
                  - src_party_id_ext
                  - src_party_id
                  - dst_party_id_bill
                  - src_party_id_bill
                  - dst_party_id
                  default: dst_party_id
                  description: 'Which party ID to be used for the terminating

                    events.'
                rate_orig_party_id:
                  type: boolean
                  default: true
                  description: 'If `True`, the originating events will be rated

                    by `src_party_id_in` mapped field, which is usually the one that

                    contains party ID in the way it has been received from the

                    customer. Otherwise the rating is done by `src_party_id_bill`,

                    which is available only for specific equipment types and contains

                    the party ID pre-processed by the equipment for billing purposes.'
                rate_term_party_id:
                  type: boolean
                  default: true
                  description: 'If `True`, the terminating events will be rated

                    by `dst_party_id_in` mapped field, which is usually the one that

                    contains party ID in the way it has been received from the

                    customer. Otherwise the rating is done by `dst_party_id_bill`,

                    which is available only for specific equipment types and contains

                    the party ID pre-processed by the equipment for billing purposes.'
                credentials_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: Credentials ID for the "Files Downloader" service.
                remote_settings:
                  oneOf:
                  - type: object
                    properties:
                      email_sender:
                        type:
                        - string
                        - 'null'
                        maxLength: 256
                        default: null
                      email_subject:
                        type:
                        - string
                        - 'null'
                        maxLength: 256
                        format: regex
                        default: null
                    required: []
                    dependentRequired: {}
                    title: imap
                  - type: object
                    properties:
                      path:
                        type: string
                    required:
                    - path
                    dependentRequired: {}
                    title: ftp
                  - type: object
                    properties: {}
                    required: []
                    dependentRequired: {}
                    title: 'null'
                  - type: object
                    properties:
                      path:
                        type: string
                    required:
                    - path
                    dependentRequired: {}
                    title: sftp
                  - type: object
                    properties:
                      path:
                        type: string
                    required:
                    - path
                    dependentRequired: {}
                    title: ssh
                  description: 'Additional settings for the "Files Downloader" service,

                    required fields according to chosen credentials.'
                fxdrs:
                  type: boolean
                  default: false
                  description: 'If `True`, the "Files Collector" service will be enabled
                    for

                    this equipment.'
                fxdrs_collectors_id:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Collector ID for the "Files Collector" service.

                    Required when `fxdrs` is `True`.'
                fxdrs_units_id:
                  type:
                  - string
                  - 'null'
                  maxLength: 5
                  default: null
                  description: 'Units ID for the "Files Collector" service.

                    Required when `fxdrs` is `True`.'
                fxdrs_skip_zero_calls:
                  type: boolean
                  default: false
                  description: 'If `True`, the events with zero volume (duration)

                    will be skipped during processing.'
                fxdrs_skip_released_calls:
                  type: boolean
                  default: false
                  description: 'If `True`, the events with "released" status

                    will be skipped during processing.'
                fxdrs_tz:
                  oneOf:
                  - default: sys
                    enum:
                    - sys
                    type: string
                  - format: timezone
                    type: string
                  type:
                  - 'null'
                  default: null
                  description: 'If defined, given timezone will override the timezone
                    of the

                    timestamp fields in the xDR files.'
                radius:
                  type: boolean
                  default: false
                  description: 'If `True`, the "RADIUS Server" service will be enabled
                    for

                    this equipment.'
                radius_collectors_id:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Collector ID for the "RADIUS Server" service.

                    Required when `radius` is `True`.'
                radius_secret:
                  type:
                  - string
                  - 'null'
                  maxLength: 128
                  default: null
                  description: 'RADIUS secret shared with the RADIUS server. Required

                    when `radius` is `True`.'
                radius_units_id:
                  type:
                  - string
                  - 'null'
                  maxLength: 5
                  default: null
                  description: 'Units ID for the "RADIUS Server" service.

                    Required when `radius` is `True`.'
                radius_active_calls:
                  type: boolean
                  default: false
                  description: 'If `True`, the "RADIUS Server" will track active

                    sessions. This produces additional load on the system and requires

                    more server resources. Use only if you need to track active sessions

                    or capacities.'
                radius_skip_zero_calls:
                  type: boolean
                  default: false
                  description: 'If `True`, the events with zero volume (duration)

                    will be skipped during processing.'
                radius_skip_released_calls:
                  type: boolean
                  default: false
                  description: 'If `True`, the events with "released" status

                    will be skipped during processing.'
                radius_save_xdrs:
                  type: boolean
                  default: true
                  description: 'If `True`, the "RADIUS Server" will produce xDR records

                    from the accounting stop packets. Typically this option should
                    be

                    set to `True`, unless you want to process accounting only by the

                    xDR files.'
                radius_write_xdrs:
                  type: boolean
                  default: false
                  description: 'If `True`, the "RADIUS Server" will write accounting

                    data into the internal xDR files, which allow reprocessing of

                    accounting data later if equipment doesn''t write its own xDR
                    files.

                    This option affects disk space used and performance of the RADIUS

                    server.'
                radius_tz:
                  oneOf:
                  - default: sys
                    enum:
                    - sys
                    type: string
                  - format: timezone
                    type: string
                  type:
                  - 'null'
                  default: null
                  description: 'If defined, given timezone will override the timezone
                    of the

                    timestamp fields in the RADIUS packets.'
                sip:
                  type: boolean
                  default: false
                  description: 'If `True`, the "SIP Server" service will be enabled
                    for this

                    equipment.'
                sip_collectors_id:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Collector ID for the "SIP Server" service.

                    Required when `sip` is `True`.'
                ac:
                  type: boolean
                  default: false
                  description: 'If `True`, the "AC Manager" service will be enabled
                    for this

                    equipment.'
                ac_collectors_id:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Collector ID for the "AC Manager" service.

                    Required when `ac` is `True`.'
                ac_credentials_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Credentials ID for the "AC Manager" service.

                    Required when `ac` is `True`.'
                ac_tz:
                  oneOf:
                  - default: sys
                    enum:
                    - sys
                    type: string
                  - format: timezone
                    type: string
                  type:
                  - 'null'
                  default: null
                  description: 'If defined, given timezone will override the timezone
                    of the

                    timestamp fields in the AC Manager packets.'
              required:
              - name
              - services_id
              - status
              dependentRequired: {}
  /integration/hooks:
    post:
      tags:
      - integration.hooks
      operationId: integration.hooks.create
      summary: Create webhook
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Webhook handler object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        integration.hooks.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 255
                  description: Name.
                ex_events_id:
                  type: string
                  description: Webhook event ID.
                type:
                  type: string
                  enum:
                  - script
                  - http
                  - https
                  description: 'Handler type. Please note that `script` type is intended
                    only

                    for internal system use.'
                task:
                  type: string
                  description: 'URL of the handler. For `script` type it''s a path
                    to the

                    script file.'
                priority:
                  type: integer
                  minimum: 0
                  maximum: 32767
                  default: 1
                  description: 'Execution priority. All webhook handlers are called

                    according to their priority. Lower values are called first.'
                status:
                  type: string
                  enum:
                  - enabled
                  - disabled
                  - archived
                  default: enabled
                  description: Status.
              required:
              - name
              - ex_events_id
              - type
              - task
              dependentRequired: {}
    get:
      tags:
      - integration.hooks
      operationId: integration.hooks.search
      summary: List webhooks
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of webhook handler objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        integration.hooks.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - ex_events_id
                    - -ex_events_id
                    - id
                    - -id
                    - name
                    - -name
                    - priority
                    - -priority
                  default: []
                  description: List of columns to order results by.
                q:
                  type: string
                  description: Quick search (wildcards allowed).
                id:
                  type: integer
                  description: Webhook handler ID.
                status:
                  type: array
                  items:
                    type: string
                    enum:
                    - enabled
                    - disabled
                    - archived
                  description: Status.
                ex_events_id:
                  type: array
                  items:
                    type: string
                  description: Webhook event ID.
                type:
                  type: string
                  enum:
                  - script
                  - http
                  - https
                  description: Handler type.
              required: []
              dependentRequired: {}
  /integration/hooks/{id}:
    get:
      tags:
      - integration.hooks
      operationId: integration.hooks.get
      summary: Get webhook
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Webhook handler ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Webhook handler object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        integration.hooks.get

        :::


        '
    patch:
      tags:
      - integration.hooks
      operationId: integration.hooks.update
      summary: Update webhook
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Webhook handler ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        integration.hooks.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 255
                  description: Name.
                ex_events_id:
                  type: string
                  description: Webhook event ID.
                type:
                  type: string
                  enum:
                  - script
                  - http
                  - https
                  description: 'Handler type. Please note that `script` type is intended
                    only

                    for internal system use.'
                task:
                  type: string
                  description: 'URL of the handler. For `script` type it''s a path
                    to the

                    script file.'
                priority:
                  type: integer
                  minimum: 0
                  maximum: 32767
                  default: 1
                  description: 'Execution priority. All webhook handlers are called

                    according to their priority. Lower values are called first.'
                status:
                  type: string
                  enum:
                  - enabled
                  - disabled
                  - archived
                  default: enabled
                  description: Status.
              required:
              - name
              - ex_events_id
              - type
              - task
              dependentRequired: {}
  /integration/hooks/events:
    get:
      tags:
      - integration.hooks.events
      operationId: integration.hooks.events.search
      summary: List events
      parameters:
      - in: query
        name: id
        schema:
          type: string
        description: Webhook event ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of webhook event objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        integration.hooks.events.search

        :::


        '
  /integration/hooks/logs/{id}:
    get:
      tags:
      - integration.hooks.logs
      operationId: integration.hooks.logs.get
      summary: Get log entry
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Webhook log entry ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Webhook log entry object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        integration.hooks.logs.get

        :::


        '
  /integration/hooks/logs:
    get:
      tags:
      - integration.hooks.logs
      operationId: integration.hooks.logs.search
      summary: List log entries
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of webhook log entry objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        integration.hooks.logs.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - dt
                    - -dt
                    - duration
                    - -duration
                    - ex_events_id
                    - -ex_events_id
                    - ex_handlers_name
                    - -ex_handlers_name
                    - id
                    - -id
                  default: []
                  description: List of columns to order results by.
                q:
                  type: string
                  description: Quick search (wildcards allowed).
                id:
                  type: integer
                  description: Webhook log entry ID.
                ex_events_id:
                  type: string
                  description: Webhook event ID.
                ex_handlers_id:
                  type: integer
                  description: Webhook handler ID.
                status:
                  type: string
                  enum:
                  - success
                  - fail
                  description: Execution status.
                error_data:
                  type: string
                  description: 'Filter by `error_data` field (for failed entries only).

                    Wildcards allowed.'
                dt:
                  type: array
                  minItems: 2
                  maxItems: 2
                  items:
                    type: string
                    format: date-time
                  example:
                  - '2025-06-10T10:00:00.000Z'
                  - '2025-07-02T16:00:00.000Z'
                  description: Log entry timestamp.
              required: []
              dependentRequired: {}
  /integration/payment_systems:
    get:
      tags:
      - integration.payment_systems
      operationId: integration.payment_systems.search
      summary: List payment systems
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of payment system objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        integration.payment_systems.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - id
                    - -id
                    - name
                    - -name
                  default: []
                  description: List of columns to order results by.
                id:
                  type: string
                  description: Payment system ID.
                name:
                  type: string
                  description: Name.
              required: []
              dependentRequired: {}
  /lnp/gateways/{id}:
    get:
      tags:
      - lnp.gateways
      operationId: lnp.gateways.get
      summary: Get gateway
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Number portability gateway ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number portability gateway object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        lnp.gateways.get

        :::


        '
    patch:
      tags:
      - lnp.gateways
      operationId: lnp.gateways.update
      summary: Update gateway
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Number portability gateway ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        lnp.gateways.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  description: Title.
                credentials_id:
                  type: integer
                  description: Credentials ID.
                remote_settings:
                  default: {}
                  oneOf:
                  - type: object
                    properties:
                      email_sender:
                        type:
                        - string
                        - 'null'
                        maxLength: 256
                        default: null
                      email_subject:
                        type:
                        - string
                        - 'null'
                        maxLength: 256
                        format: regex
                        default: null
                    required: []
                    dependentRequired: {}
                    title: imap
                  - type: object
                    properties: {}
                    required: []
                    dependentRequired: {}
                    title: web
                  - type: object
                    properties:
                      path:
                        type: string
                    required:
                    - path
                    dependentRequired: {}
                    title: ftp
                  - type: object
                    properties: {}
                    required: []
                    dependentRequired: {}
                    title: 'null'
                  - type: object
                    properties:
                      path:
                        type: string
                    required:
                    - path
                    dependentRequired: {}
                    title: ssh
                  description: 'Additional settings for the "Files Downloader" service,

                    required fields according to chosen credentials.'
              required:
              - title
              - credentials_id
              dependentRequired: {}
  /lnp/gateways:
    get:
      tags:
      - lnp.gateways
      operationId: lnp.gateways.search
      summary: List gateways
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of gateway objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        lnp.gateways.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - credentials_id
                    - -credentials_id
                    - editable
                    - -editable
                    - id
                    - -id
                    - name
                    - -name
                    - title
                    - -title
                  default: []
                  description: List of columns to order results by.
                id:
                  type: integer
                  description: Number portability gateway ID.
                name:
                  type: string
                  description: Name.
                editable:
                  type: boolean
                  description: If `True`, include only gateways that can be edited.
              required: []
              dependentRequired: {}
  /lnp/ranges:
    post:
      tags:
      - lnp.ranges
      operationId: lnp.ranges.create
      summary: Create range
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number portability range object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        lnp.ranges.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                gateways_id:
                  type: integer
                  description: Number portability gateway ID.
                range_from:
                  type: string
                  description: Range starting number.
                range_to:
                  type: string
                  description: 'Range ending number. To add a single number, use the
                    same

                    value for both starting and ending.'
                owner:
                  type: string
                  description: Range owner (applied as tag during traffic processing).
                effective_date:
                  type:
                  - string
                  - 'null'
                  format: date-time
                  default: now()
                  description: Effective date.
                end_date:
                  type:
                  - string
                  - 'null'
                  format: date-time
                  default: null
                  description: End date.
                rn_number:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Routing number (replaces original number during traffic

                    processing).'
                prefix:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Portability prefix (added to original number during
                    traffic

                    processing).'
              required:
              - gateways_id
              - range_from
              - range_to
              - owner
              dependentRequired: {}
    get:
      tags:
      - lnp.ranges
      operationId: lnp.ranges.search
      summary: List ranges
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of number portability range objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        lnp.ranges.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - effective_date
                    - -effective_date
                    - gateways_id
                    - -gateways_id
                    - id
                    - -id
                    - owner
                    - -owner
                    - prefix
                    - -prefix
                    - range_from
                    - -range_from
                    - range_to
                    - -range_to
                    - rn_number
                    - -rn_number
                  default: []
                  description: List of columns to order results by.
                id:
                  type: integer
                  description: Number portability range ID.
                gateways_id:
                  type: integer
                  description: Number portability gateway ID.
                number:
                  type: string
                  description: Number to be contained in the range.
                effective_date:
                  type: array
                  minItems: 2
                  maxItems: 2
                  items:
                    type: string
                    format: date-time
                  example:
                  - '2025-06-10T10:00:00.000Z'
                  - '2025-07-02T16:00:00.000Z'
                  description: Effective date.
              required: []
              dependentRequired: {}
  /lnp/ranges/{id}:
    delete:
      tags:
      - lnp.ranges
      operationId: lnp.ranges.delete
      summary: Delete range
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Number portability range ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        lnp.ranges.delete

        :::


        '
    get:
      tags:
      - lnp.ranges
      operationId: lnp.ranges.get
      summary: Get range
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Number portability range ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number portability range object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        lnp.ranges.get

        :::


        '
    patch:
      tags:
      - lnp.ranges
      operationId: lnp.ranges.update
      summary: Update range
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Range ID
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        lnp.ranges.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                gateways_id:
                  type: integer
                  description: Number portability gateway ID.
                range_from:
                  type: string
                  description: Range starting number.
                range_to:
                  type: string
                  description: 'Range ending number. To add a single number, use the
                    same

                    value for both starting and ending.'
                owner:
                  type: string
                  description: Range owner (applied as tag during traffic processing).
                effective_date:
                  type:
                  - string
                  - 'null'
                  format: date-time
                  default: now()
                  description: Effective date.
                end_date:
                  type:
                  - string
                  - 'null'
                  format: date-time
                  default: null
                  description: End date.
                rn_number:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Routing number (replaces original number during traffic

                    processing).'
                prefix:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Portability prefix (added to original number during
                    traffic

                    processing).'
              required:
              - gateways_id
              - range_from
              - range_to
              - owner
              dependentRequired: {}
  /packages:
    post:
      tags:
      - packages
      operationId: packages.create
      summary: Create package
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Package object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        packages.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                companies_id:
                  type: integer
                  description: Partition ID.
                name:
                  type: string
                  maxLength: 128
                  description: Name.
                period:
                  type: string
                  format: duration
                  description: 'Duration of the package (renewal period). To be given
                    in

                    ISO 8601 format.'
                currencies_id:
                  type: integer
                  description: Currency ID.
                status:
                  type: string
                  enum:
                  - active
                  - disabled
                  - archive
                  default: active
                  description: Status.
                priority:
                  type: integer
                  minimum: -2147483647
                  maximum: 2147483647
                  default: 0
                  description: 'Priority of entitlements application. If there are
                    multiple

                    subscriptions that provide entitlements that match specific event,

                    the subscription with the lowest `priority` will be used.'
                effective_from:
                  type:
                  - string
                  - 'null'
                  format: date-time
                  default: null
                  description: 'Time-limited package: start timestamp from which the

                    package becomes available for assignment and use by the client.'
                effective_till:
                  type:
                  - string
                  - 'null'
                  format: date-time
                  default: null
                  description: 'Time-limited package: end timestamp till which the

                    package remains available for assignment and use by the client.'
                tag_add:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Tag that will be added to the events billed by this
                    package.
                charge_on_event:
                  type: boolean
                  default: false
                  description: 'If `True`, first subscription fee will be charged

                    when the first event occurs within this package period. Until

                    the fees will not be charged.'
                charging:
                  type: string
                  enum:
                  - pre_activation
                  - period_start
                  default: pre_activation
                  description: "Defines when the subscription fee is accounted:\n\
                    * `pre_activation` - the charges are dated at the end of the\n\
                    \    preceding period (e.g. for the period that starts on Oct\
                    \ 1st,\n    the charges will be dated on Sep 30th).\n* `period_start`\
                    \ - the charges are dated at the beginning of the\n    current\
                    \ period (e.g. for the period that starts on Oct 1st,\n    the\
                    \ charges will be dated on Oct 1st)."
                fees:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                        - activation
                        - periodical
                        description: Type of the fee.
                      name:
                        type: string
                        description: Fee name. This is used to identify the fee in
                          the invoice line items.
                      rate:
                        type: number
                        format: decimal
                        description: Fee value.
                      default:
                        type: boolean
                        description: If `True`, the fee is marked as default. In common
                          scenario, the package has only default fees. The discounts,
                          if used, are applied to the default fee. Non-default fees
                          are used for special cases, when you need to outline multiple
                          fees as separate invoice line items.
                        default: false
                      note:
                        type:
                        - string
                        - 'null'
                        description: Fee note.
                        default: null
                      tags:
                        type: array
                        items:
                          type: string
                        description: Tag(s) for the fee. These are intended to be
                          used for determining tax that has to be applied to the fee.
                        default: []
                    required:
                    - type
                    - name
                    - rate
                    dependentRequired: {}
                  default: []
                  description: List of fees applied to the package.
                charge_setup_fee:
                  type: boolean
                  default: true
                  description: 'If `True`, setup fee will be charged regardless of

                    the entitlements usage. Only the cost of the event itself will
                    be

                    counted by the package.'
                discounts:
                  type: array
                  items:
                    type: object
                    properties:
                      renew_no:
                        type: integer
                        minimum: 0
                        description: Renewal sequential number.
                      discount:
                        type: number
                        format: decimal
                        minimum: 0.0
                        description: Discount value. Value to be given in the same
                          currency as the package fees.
                    required:
                    - renew_no
                    - discount
                    dependentRequired: {}
                  default: []
                  description: 'Discount settings based on the number of package renewals.

                    Not applied if fees are overridden during package activation.

                    The discount is chosen based by finding the largest `renew_no`

                    that is less than or equal to the number of package renewals.

                    For example, if the package has 3 renewals, and the discount with

                    `renew_no` equal to 2 is set, then the discount will be applied.'
                payment_terms_full_charge:
                  type: boolean
                  default: false
                  description: 'If `True`, the package will be charged

                    in full on the first activation and full entitlements will be

                    provided. Only duration will be prorated.'
                renew_advance:
                  type: string
                  format: duration
                  default: PT1H
                  description: 'How far in advance to try to renew the package. It
                    is

                    typically good idea to renew the package before the end of the

                    current period, to provide uninterrupted service.'
                renew_due:
                  type:
                  - string
                  - 'null'
                  format: duration
                  default: null
                  description: 'For how long to try to renew the package after unsuccessful

                    renewal attempt (e.g. if the client has insufficient funds). After

                    this period, the package will be deactivated.'
                with_taxes:
                  type: boolean
                  default: false
                  description: 'If `True`, the system assumes that fees defined for
                    the

                    package already include taxes. In this case taxes will be

                    reversed from the fees when the package is activated.'
                payment_terms_align:
                  type: boolean
                  default: false
                  description: 'If `True`, the package will be prorated on the

                    first activation according to the payment terms (billing cycle)

                    of the client. In this case subscription fees and all entitlements

                    will be prorated.'
                activate_ignore_balance:
                  type: boolean
                  default: false
                  description: 'If `True`, the package will be activated

                    disregarding client balance. This may lead to negative balance

                    for prepaid clients.'
                code_decks_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Service entitlement: code deck ID to be used for

                    service limits if defined by code name(s).'
                limits:
                  type: array
                  items:
                    type: object
                    properties:
                      services_id:
                        type: integer
                        description: Service ID.
                      origin:
                        type: string
                        enum:
                        - orig
                        - term
                        - both
                        description: 'Traffic origin: In many cases only `orig` is
                          used. Use `term` to include incoming paid events (calls).
                          Use `both` to include both incoming and outgoing paid events.'
                      limit_type:
                        type: string
                        enum:
                        - money
                        - volume
                        description: Limit type. In case of `volume` the limit is
                          defined in the units of the respective service. In case
                          of `money` the limit is defined as cash value and deducted
                          according to the regular rates defined for the client.
                      limit:
                        type: number
                        format: decimal
                        minimum: 0.0
                        description: Limit value. Given either in the units of the
                          respective service or as cash value, depending on the `limit_type`.
                      code:
                        type:
                        - string
                        - 'null'
                        description: Code to which limit is applicable. Either `code`
                          or `code_name` must be specified.
                        default: null
                      code_name:
                        type:
                        - string
                        - 'null'
                        description: Code Name to which limit is applicable. Either
                          `code` or `code_name` must be specified.
                        default: null
                    required:
                    - services_id
                    - origin
                    - limit_type
                    - limit
                    dependentRequired: {}
                  default: []
                  description: 'Service entitlement: list of service limits.'
                dids_qty:
                  type: integer
                  minimum: 0
                  maximum: 2147483647
                  default: 0
                  description: 'DID entitlement: DIDs quantity. Only that many DIDs

                    will be possible to assign to the client within this package.'
                dids_hold_days:
                  type: integer
                  minimum: 0
                  maximum: 2147483647
                  default: 0
                  description: 'DID entitlement: number of days DIDs are kept on

                    hold after package deactivation. This is used to allow DIDs to

                    "cool down" after they have been used by the client.'
                dids_tags:
                  type: array
                  items:
                    type: string
                  default: []
                  description: 'DID entitlement: allowed DID tags. Use to determine

                    level of DIDs that can be assigned to the client (e.g. gold,

                    premium, etc.).'
              required:
              - companies_id
              - name
              - period
              - currencies_id
              dependentRequired: {}
    get:
      tags:
      - packages
      operationId: packages.search
      summary: List packages
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of package objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        packages.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - companies_id
                    - -companies_id
                    - id
                    - -id
                    - name
                    - -name
                    - period
                    - -period
                    - status
                    - -status
                  default: []
                  description: List of columns to order results by.
                q:
                  type: string
                  description: Quick search (wildcards allowed).
                id:
                  type: array
                  items:
                    type: integer
                  description: Package ID.
                name:
                  type: string
                  description: Name.
                status:
                  type: array
                  items:
                    type: string
                    enum:
                    - active
                    - disabled
                    - archive
                  description: Status.
                companies_id:
                  type: array
                  items:
                    type: integer
                  description: Partition ID.
                tag_add:
                  type: string
                  description: Tag added by the package to the events billed by it.
                dids_tags_all:
                  type: array
                  items:
                    type: string
                  description: DID tags, uses "match all" logic.
              required: []
              dependentRequired: {}
  /packages/{id}:
    delete:
      tags:
      - packages
      operationId: packages.delete
      summary: Delete package
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Package ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        packages.delete

        :::


        Delete is possible only if the package hasn''t been used anywhere in the

        system (e.g. subscriptions).'
    get:
      tags:
      - packages
      operationId: packages.get
      summary: Get package
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Package ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Package object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        packages.get

        :::


        '
    patch:
      tags:
      - packages
      operationId: packages.update
      summary: Update package
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Package ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        packages.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                companies_id:
                  type: integer
                  description: Partition ID.
                name:
                  type: string
                  maxLength: 128
                  description: Name.
                period:
                  type: string
                  format: duration
                  description: 'Duration of the package (renewal period). To be given
                    in

                    ISO 8601 format.'
                currencies_id:
                  type: integer
                  description: Currency ID.
                status:
                  type: string
                  enum:
                  - active
                  - disabled
                  - archive
                  default: active
                  description: Status.
                priority:
                  type: integer
                  minimum: -2147483647
                  maximum: 2147483647
                  default: 0
                  description: 'Priority of entitlements application. If there are
                    multiple

                    subscriptions that provide entitlements that match specific event,

                    the subscription with the lowest `priority` will be used.'
                effective_from:
                  type:
                  - string
                  - 'null'
                  format: date-time
                  default: null
                  description: 'Time-limited package: start timestamp from which the

                    package becomes available for assignment and use by the client.'
                effective_till:
                  type:
                  - string
                  - 'null'
                  format: date-time
                  default: null
                  description: 'Time-limited package: end timestamp till which the

                    package remains available for assignment and use by the client.'
                tag_add:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Tag that will be added to the events billed by this
                    package.
                charge_on_event:
                  type: boolean
                  default: false
                  description: 'If `True`, first subscription fee will be charged

                    when the first event occurs within this package period. Until

                    the fees will not be charged.'
                charging:
                  type: string
                  enum:
                  - pre_activation
                  - period_start
                  default: pre_activation
                  description: 'Defined when the subscription fee is accounted. In
                    case of

                    `pre_activation` the charges are dated at the end of the preceding

                    period (e.g. for the period that starts on Oct 1st, the charges

                    will be dated on Sep 30th). In case of `period_start` the charges

                    are dated at the beginning of the current period (e.g. for the

                    period that starts on Oct 1st, the charges will be dated on Oct
                    1st).'
                fees:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                        - activation
                        - periodical
                        description: Type of the fee.
                      name:
                        type: string
                        description: Fee name. This is used to identify the fee in
                          the invoice line items.
                      rate:
                        type: number
                        format: decimal
                        description: Fee value.
                      default:
                        type: boolean
                        description: If `True`, the fee is marked as default. In common
                          scenario, the package has only default fees. The discounts,
                          if used, are applied to the default fee. Non-default fees
                          are used for special cases, when you need to outline multiple
                          fees as separate invoice line items.
                        default: false
                      note:
                        type:
                        - string
                        - 'null'
                        description: Fee note.
                        default: null
                      tags:
                        type: array
                        items:
                          type: string
                        description: Tag(s) for the fee. These are intended to be
                          used for determining tax that has to be applied to the fee.
                        default: []
                    required:
                    - type
                    - name
                    - rate
                    dependentRequired: {}
                  default: []
                  description: List of fees applied to the package.
                charge_setup_fee:
                  type: boolean
                  default: true
                  description: 'If `True`, setup fee will be charged regardless of

                    the entitlements usage. Only the cost of the event itself will
                    be

                    counted by the package.'
                discounts:
                  type: array
                  items:
                    type: object
                    properties:
                      renew_no:
                        type: integer
                        minimum: 0
                        description: Renewal sequential number.
                      discount:
                        type: number
                        format: decimal
                        minimum: 0.0
                        description: Discount value. Value to be given in the same
                          currency as the package fees.
                    required:
                    - renew_no
                    - discount
                    dependentRequired: {}
                  default: []
                  description: 'Discount settings based on the number of package renewals.

                    Not applied if fees are overridden during package activation.

                    The discount is chosen based by finding the largest `renew_no`

                    that is less than or equal to the number of package renewals.

                    For example, if the package has 3 renewals, and the discount with

                    `renew_no` equal to 2 is set, then the discount will be applied.'
                payment_terms_full_charge:
                  type: boolean
                  default: false
                  description: 'If `True`, the package will be charged

                    in full on the first activation and full entitlements will be

                    provided. Only duration will be prorated.'
                renew_advance:
                  type: string
                  format: duration
                  default: PT1H
                  description: 'How far in advance to try to renew the package. It
                    is

                    typically good idea to renew the package before the end of the

                    current period, to provide uninterrupted service.'
                renew_due:
                  type:
                  - string
                  - 'null'
                  format: duration
                  default: null
                  description: 'For how long to try to renew the package after unsuccessful

                    renewal attempt (e.g. if the client has insufficient funds). After

                    this period, the package will be deactivated.'
                with_taxes:
                  type: boolean
                  default: false
                  description: 'If `True`, the system assumes that fees defined for
                    the

                    package already include taxes. In this case taxes will be

                    reversed from the fees when the package is activated.'
                payment_terms_align:
                  type: boolean
                  default: false
                  description: 'If `True`, the package will be prorated on the

                    first activation according to the payment terms (billing cycle)

                    of the client. In this case subscription fees and all entitlements

                    will be prorated.'
                activate_ignore_balance:
                  type: boolean
                  default: false
                  description: 'If `True`, the package will be activated

                    disregarding client balance. This may lead to negative balance

                    for prepaid clients.'
                code_decks_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Service entitlement: code deck ID to be used for

                    service limits if defined by code name(s).'
                limits:
                  type: array
                  items:
                    type: object
                    properties:
                      services_id:
                        type: integer
                        description: Service ID.
                      origin:
                        type: string
                        enum:
                        - orig
                        - term
                        - both
                        description: 'Traffic origin: In many cases only `orig` is
                          used. Use `term` to include incoming paid events (calls).
                          Use `both` to include both incoming and outgoing paid events.'
                      limit_type:
                        type: string
                        enum:
                        - money
                        - volume
                        description: Limit type. In case of `volume` the limit is
                          defined in the units of the respective service. In case
                          of `money` the limit is defined as cash value and deducted
                          according to the regular rates defined for the client.
                      limit:
                        type: number
                        format: decimal
                        minimum: 0.0
                        description: Limit value. Given either in the units of the
                          respective service or as cash value, depending on the `limit_type`.
                      code:
                        type:
                        - string
                        - 'null'
                        description: Code to which limit is applicable. Either `code`
                          or `code_name` must be specified.
                        default: null
                      code_name:
                        type:
                        - string
                        - 'null'
                        description: Code Name to which limit is applicable. Either
                          `code` or `code_name` must be specified.
                        default: null
                    required:
                    - services_id
                    - origin
                    - limit_type
                    - limit
                    dependentRequired: {}
                  default: []
                  description: 'Service entitlement: list of service limits.'
                dids_qty:
                  type: integer
                  minimum: 0
                  maximum: 2147483647
                  default: 0
                  description: 'DID entitlement: DIDs quantity. Only that many DIDs

                    will be possible to assign to the client within this package.'
                dids_hold_days:
                  type: integer
                  minimum: 0
                  maximum: 2147483647
                  default: 0
                  description: 'DID entitlement: number of days DIDs are kept on

                    hold after package deactivation. This is used to allow DIDs to

                    "cool down" after they have been used by the client.'
                dids_tags:
                  type: array
                  items:
                    type: string
                  default: []
                  description: 'DID entitlement: allowed DID tags. Use to determine

                    level of DIDs that can be assigned to the client (e.g. gold,

                    premium, etc.).'
              required:
              - companies_id
              - name
              - period
              - currencies_id
              dependentRequired: {}
  /packages/custom_fields/{id}:
    get:
      tags:
      - packages.custom_fields
      operationId: packages.custom_fields.get
      summary: Get custom fields
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Package ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Custom field object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        packages.custom_fields.get

        :::


        '
    patch:
      tags:
      - packages.custom_fields
      operationId: packages.custom_fields.update
      summary: Update custom fields
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Package ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        packages.custom_fields.update

        :::


        The method allows extra fields to be provided according to the

        the custom fields definition. The name of the field should be

        equal to the `key` of the custom field definition.'
  /rates:
    post:
      tags:
      - rates
      operationId: rates.create
      summary: Create rate
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: 'List of rate objects as have been stored. List is returned
            instead of

            the single object, since multiple rate object may be created, if code

            name has been given instead of a single code.'
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ":::note[JSON-RPC]\nrates.create\n:::\n\n:::info Code formatting\n\
        Code fields (both `code` and `src_code`) support the following syntax:\n \
        \   * `44` - single code (will be created as is);\n    * `44301,44303` - multiple\
        \ codes separated by comma (will be created\n        as rates for `44301`\
        \ and `44303`);\n    * `44301-44303` - range of codes (will be created as\
        \ rates for\n        `44301`, `44302` and `44303`);\n    * `443(0-2)1` - internal\
        \ range of codes (will be created as rates for\n        `44301`, `44311` and\
        \ `44321`).\n\nAny of the definitions can be combined.\n:::"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                rate_tables_id:
                  type: integer
                  description: Rate table ID.
                effective_from:
                  type: string
                  format: date-time
                  description: Effective date.
                value:
                  type: number
                  format: decimal
                  minimum: -999999999.0
                  maximum: 999999999.0
                  description: 'Rate for a single unit of the event. The unit is defined
                    by

                    `rating_units_id` attribute of the respective service.'
                time_profiles_id:
                  type: integer
                  description: Time profile ID.
                code:
                  type: string
                  maxLength: 64
                  default: ''
                  description: 'Destination code(s). Either `code` or `code_names`
                    must be

                    provided, but not both.'
                src_code:
                  type: string
                  maxLength: 64
                  default: ''
                  description: 'Source code(s). If empty, the rate matches all source
                    codes.

                    Either `src_code` or `src_code_name` may be provided, but not
                    both.'
                src_code_name:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Source code name(s). If empty, the rate matches all

                    source codes. Either `src_code` or `src_code_name` may be provided,

                    but not both.'
                end_date:
                  type:
                  - string
                  - 'null'
                  format: date-time
                  default: null
                  description: 'End date. If not defined, the rate is active till
                    the next

                    effective date of the next rate with the same code.'
                min_volume:
                  type: integer
                  minimum: 1
                  default: 1
                  description: 'Minimum billed volume. To be defined in the units
                    of

                    `rating_params_units_id` attribute of the respective service.'
                pay_interval:
                  type: integer
                  minimum: 1
                  default: 1
                  description: 'Payment interval. Applied when volume of the event
                    is

                    greater than `min_volume`. To be defined in the units of

                    `rating_params_units_id` attribute of the respective service.'
                pay_setup:
                  type: number
                  format: decimal
                  default: 0
                  description: Setup fee. Charged when volume of the event is not
                    zero.
                grace_volume:
                  type: integer
                  minimum: 0
                  default: 0
                  description: 'Volume below which events will not be billed. To be

                    defined in the units of `rating_params_units_id` attribute of
                    the

                    respective service.'
                tag:
                  type: string
                  default: '@'
                  description: Tag.
                num_length_max:
                  type:
                  - integer
                  - 'null'
                  minimum: 1
                  default: null
                  description: 'Maximum dst number length. If destination number does

                    not match the length, the rate will not be applied.'
                num_length_min:
                  type:
                  - integer
                  - 'null'
                  minimum: 1
                  default: null
                  description: 'Minimum dst number length. If destination number does

                    not match the length, the rate will not be applied.'
                notes:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Notes.
                status:
                  type: string
                  enum:
                  - active
                  - stashed
                  default: active
                  description: Status.
                code_names:
                  type: array
                  items:
                    type: string
                  default: []
                  description: 'Destination code name(s). Either `code` or `code_names`

                    must be provided, but not both.'
                stash_future:
                  type: boolean
                  default: false
                  description: 'If `True`, the rates with the same code for the future

                    will be set in `stashed` status.'
                force_notification:
                  type: boolean
                  default: false
                  description: 'If `True`, the notification will be sent after new

                    rate creation.'
              required:
              - rate_tables_id
              - effective_from
              - value
              - time_profiles_id
              dependentRequired: {}
    get:
      tags:
      - rates
      operationId: rates.search
      summary: List rates
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of rate objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        rates.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - code
                    - -code
                    - currencies_id
                    - -currencies_id
                    - effective_from
                    - -effective_from
                    - effective_till
                    - -effective_till
                    - end_date
                    - -end_date
                    - grace_volume
                    - -grace_volume
                    - id
                    - -id
                    - min_volume
                    - -min_volume
                    - notes
                    - -notes
                    - pay_interval
                    - -pay_interval
                    - pay_setup
                    - -pay_setup
                    - rate_tables_id
                    - -rate_tables_id
                    - src_code
                    - -src_code
                    - status
                    - -status
                    - tag
                    - -tag
                    - time_profiles_id
                    - -time_profiles_id
                    - value
                    - -value
                  description: List of columns to order results by.
                  default: []
                rate_tables_id:
                  type: integer
                  description: Rate table ID.
                state:
                  type: string
                  enum:
                  - current_future
                  - current
                  - future
                  - past
                  - all
                  description: Timeline state of the rate at the timestamp given in
                    `dt` field.
                  default: current_future
                dt:
                  type: string
                  format: date-time
                  description: Timestamp to be used in conjunction with `state` field
                    to define the timestamp at which the rate state should be checked.
                q:
                  type: string
                  description: Quick search (wildcards allowed).
                code:
                  type: string
                  maxLength: 64
                  description: Destination code (wildcards allowed).
                code_in:
                  type: array
                  items:
                    type: string
                    maxLength: 64
                  description: Destination codes list.
                code_like:
                  type: string
                  description: Search by destination code or code name at the same
                    time (wildcards allowed). Use with caution, depending on the state
                    of other filters may by result consuming.
                code_name:
                  type: string
                  description: Destination code name (wildcards allowed).
                src_code:
                  type: string
                  maxLength: 64
                  description: Source code (wildcards allowed).
                src_code_in:
                  type: array
                  items:
                    type: string
                    maxLength: 64
                  description: Source codes list.
                src_code_name:
                  type: string
                  description: Source code name (wildcards allowed).
                id:
                  type: array
                  items:
                    type: integer
                  description: Rate ID.
                status:
                  type: string
                  enum:
                  - active
                  - stashed
                  description: Rate status.
                currencies_id:
                  type: integer
                  description: Currency ID.
                time_profiles_id:
                  type: array
                  items:
                    type: integer
                  description: Time profile ID.
                tag:
                  type: array
                  items:
                    type: string
                  description: Rate tag.
                pay_setup:
                  type: array
                  minItems: 2
                  maxItems: 2
                  items:
                    type: number
                    format: decimal
                  example:
                  - 0.1
                  - 10.1
                  description: Setup fee.
                value:
                  type: array
                  minItems: 2
                  maxItems: 2
                  items:
                    type: number
                    format: decimal
                  example:
                  - 0.1
                  - 10.1
                  description: Rate value.
                end_date:
                  type: array
                  minItems: 2
                  maxItems: 2
                  items:
                    type: string
                    format: date-time
                  example:
                  - '2025-06-10T10:00:00.000Z'
                  - '2025-07-02T16:00:00.000Z'
                  description: End date.
                min_volume:
                  type: array
                  minItems: 2
                  maxItems: 2
                  items:
                    type: integer
                  example:
                  - 1
                  - 9
                  description: Minimum billed volume.
                pay_interval:
                  type: array
                  minItems: 2
                  maxItems: 2
                  items:
                    type: integer
                  example:
                  - 1
                  - 9
                  description: Pay interval.
                grace_volume:
                  type: array
                  minItems: 2
                  maxItems: 2
                  items:
                    type: integer
                  example:
                  - 1
                  - 9
                  description: Grace volume.
                num_length_max_lte:
                  type: integer
                  minimum: 1
                  description: Maximum destination number length.
                num_length_min_gte:
                  type: integer
                  minimum: 1
                  description: Minimum destination number length.
                notes:
                  type: string
                  description: Rate notes.
                blocked:
                  type: boolean
                  description: If `True`, return only blocked rates.
                next_rates_diff_status:
                  type: string
                  enum:
                  - new
                  - increased
                  - decreased
                  - unchanged
                  - blocked
                  description: Status of the next rate.
                prev_rates_diff_status:
                  type: string
                  enum:
                  - new
                  - increased
                  - decreased
                  - unchanged
                  - blocked
                  description: Status of the previous rate.
                notification_status:
                  type: string
                  enum:
                  - sent
                  - not_sent
                  description: Rate notification status at the timestamp given in
                    `notification_dt` field.
                notification_dt:
                  type: string
                  format: date-time
                  description: Timestamp to be used in conjunction with `notification_status`
                    field to define the timestamp at which the rate notification status
                    should be checked.
                rates_id:
                  type: integer
                  description: Special rate ID (to find related children rates).
                rate_tables_logs_id:
                  type: integer
                  description: Rate table log ID (to filter rates from the specific
                    import).
              required: []
              dependentRequired:
                notification_status:
                - notification_dt
  /rates/blocked:
    post:
      tags:
      - rates
      operationId: rates.create_block
      summary: Create blocked rate
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: 'List of rate objects as have been stored. List is returned
            instead of

            the single object, since multiple rate object may be created, if code

            name has been given instead of a single code.'
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        rates.create_block

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                rate_tables_id:
                  type: integer
                  description: Rate table ID.
                effective_from:
                  type: string
                  format: date-time
                  description: Effective date.
                time_profiles_id:
                  type: integer
                  description: Time profile ID.
                code:
                  type: string
                  maxLength: 64
                  default: ''
                  description: 'Destination code(s). Either `code` or `code_names`
                    must be

                    provided, but not both.'
                src_code:
                  type: string
                  maxLength: 64
                  default: ''
                  description: 'Source code(s). If empty, the rate matches all source
                    codes.

                    Either `src_code` or `src_code_name` may be provided, but not
                    both.'
                src_code_name:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Source code name(s). If empty, the rate matches all

                    source codes. Either `src_code` or `src_code_name` may be provided,

                    but not both.'
                end_date:
                  type:
                  - string
                  - 'null'
                  format: date-time
                  default: null
                  description: 'End date. If not defined, the rate is active till
                    the next

                    effective date of the next rate with the same code.'
                tag:
                  type: string
                  default: '@'
                  description: Tag.
                notes:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Notes.
                status:
                  type: string
                  enum:
                  - active
                  - stashed
                  default: active
                  description: Status.
                code_names:
                  type: array
                  items:
                    type: string
                  default: []
                  description: 'Destination code name(s). Either `code` or `code_names`

                    must be provided, but not both.'
              required:
              - rate_tables_id
              - effective_from
              - time_profiles_id
              dependentRequired: {}
  /rates/{id}:
    delete:
      tags:
      - rates
      operationId: rates.delete
      summary: Delete rate
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Rate ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        rates.delete

        :::


        '
    patch:
      tags:
      - rates
      operationId: rates.update
      summary: Update rate
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Rate ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        rates.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                code:
                  type: string
                  maxLength: 64
                  description: Destination code.
                effective_from:
                  type: string
                  format: date-time
                  description: Effective date.
                value:
                  type: number
                  format: decimal
                  minimum: -999999999.0
                  maximum: 999999999.0
                  description: 'Rate for a single unit of the event. The unit is defined
                    by

                    `rating_units_id` attribute of the respective service.'
                time_profiles_id:
                  type: integer
                  description: Time profile ID.
                src_code:
                  type: string
                  maxLength: 64
                  default: ''
                  description: Source code. If empty, the rate matches all source
                    codes.
                end_date:
                  type:
                  - string
                  - 'null'
                  format: date-time
                  default: null
                  description: 'End date. If not defined, the rate is active till
                    the next

                    effective date of the next rate with the same code.'
                min_volume:
                  type: integer
                  minimum: 1
                  default: 1
                  description: 'Minimum billed volume. To be defined in the units
                    of

                    `rating_params_units_id` attribute of the respective service.'
                pay_interval:
                  type: integer
                  minimum: 1
                  default: 1
                  description: 'Payment interval. Applied when volume of the event
                    is

                    greater than `min_volume`. To be defined in the units of

                    `rating_params_units_id` attribute of the respective service.'
                pay_setup:
                  type: number
                  format: decimal
                  default: 0
                  description: Setup fee. Charged when volume of the event is not
                    zero.
                grace_volume:
                  type: integer
                  minimum: 0
                  default: 0
                  description: 'Volume below which events will not be billed. To be

                    defined in the units of `rating_params_units_id` attribute of
                    the

                    respective service.'
                tag:
                  type: string
                  default: '@'
                  description: Tag.
                num_length_max:
                  type:
                  - integer
                  - 'null'
                  minimum: 1
                  default: null
                  description: 'Maximum dst number length. If destination number does

                    not match the length, the rate will not be applied.'
                num_length_min:
                  type:
                  - integer
                  - 'null'
                  minimum: 1
                  default: null
                  description: 'Minimum dst number length. If destination number does

                    not match the length, the rate will not be applied.'
                notes:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Notes.
                status:
                  type: string
                  enum:
                  - active
                  - stashed
                  default: active
                  description: Status.
                update_relations:
                  type: boolean
                  default: true
                  description: 'If `True`, the rate table relations should be

                    updated. For internal use only. Keep `True` by default.'
              required:
              - code
              - effective_from
              - value
              - time_profiles_id
              dependentRequired: {}
  /rates/blocked/{id}:
    patch:
      tags:
      - rates
      operationId: rates.update_block
      summary: Update blocked rate
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Rate ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        rates.update_block

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                code:
                  type: string
                  maxLength: 64
                  description: Destination code.
                effective_from:
                  type: string
                  format: date-time
                  description: Effective date.
                time_profiles_id:
                  type: integer
                  description: Time profile ID.
                src_code:
                  type: string
                  maxLength: 64
                  default: ''
                  description: Source code. If empty, the rate matches all source
                    codes.
                end_date:
                  type:
                  - string
                  - 'null'
                  format: date-time
                  default: null
                  description: 'End date. If not defined, the rate is active till
                    the next

                    effective date of the next rate with the same code.'
                tag:
                  type: string
                  default: '@'
                  description: Tag.
                notes:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Notes.
                status:
                  type: string
                  enum:
                  - active
                  - stashed
                  default: active
                  description: Status.
                update_relations:
                  type: boolean
                  default: true
                  description: 'If `True`, the rate table relations should be

                    updated. For internal use only. Keep `True` by default.'
              required:
              - code
              - effective_from
              - time_profiles_id
              dependentRequired: {}
  /rates/bulk:
    post:
      tags:
      - rates
      operationId: rates.update_bulk
      summary: Update rates by filter
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        rates.update_bulk

        :::


        :::info

        If any of the new values is not set, it will be left unchanged.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                action:
                  type: string
                  enum:
                  - insert
                  - update
                  - delete
                  - preview
                  description: Bulk action.
                search:
                  type: object
                  properties:
                    limit:
                      type: integer
                      description: Number of rows to return (for pagination).
                      default: 20
                    offset:
                      type: integer
                      description: Number of rows to skip (for pagination).
                      default: 0
                    order:
                      type: array
                      items:
                        type: string
                        enum:
                        - code
                        - -code
                        - currencies_id
                        - -currencies_id
                        - effective_from
                        - -effective_from
                        - effective_till
                        - -effective_till
                        - end_date
                        - -end_date
                        - grace_volume
                        - -grace_volume
                        - id
                        - -id
                        - min_volume
                        - -min_volume
                        - notes
                        - -notes
                        - pay_interval
                        - -pay_interval
                        - pay_setup
                        - -pay_setup
                        - rate_tables_id
                        - -rate_tables_id
                        - src_code
                        - -src_code
                        - status
                        - -status
                        - tag
                        - -tag
                        - time_profiles_id
                        - -time_profiles_id
                        - value
                        - -value
                      description: List of columns to order results by.
                      default: []
                    rate_tables_id:
                      type: integer
                      description: Rate table ID.
                    state:
                      type: string
                      enum:
                      - current_future
                      - current
                      - future
                      - past
                      - all
                      description: Timeline state of the rate at the timestamp given
                        in `dt` field.
                      default: current_future
                    dt:
                      type: string
                      format: date-time
                      description: Timestamp to be used in conjunction with `state`
                        field to define the timestamp at which the rate state should
                        be checked.
                    q:
                      type: string
                      description: Quick search (wildcards allowed).
                    code:
                      type: string
                      maxLength: 64
                      description: Destination code (wildcards allowed).
                    code_in:
                      type: array
                      items:
                        type: string
                        maxLength: 64
                      description: Destination codes list.
                    code_like:
                      type: string
                      description: Search by destination code or code name at the
                        same time (wildcards allowed). Use with caution, depending
                        on the state of other filters may by result consuming.
                    code_name:
                      type: string
                      description: Destination code name (wildcards allowed).
                    src_code:
                      type: string
                      maxLength: 64
                      description: Source code (wildcards allowed).
                    src_code_in:
                      type: array
                      items:
                        type: string
                        maxLength: 64
                      description: Source codes list.
                    src_code_name:
                      type: string
                      description: Source code name (wildcards allowed).
                    id:
                      type: array
                      items:
                        type: integer
                      description: Rate ID.
                    status:
                      type: string
                      enum:
                      - active
                      - stashed
                      description: Rate status.
                    currencies_id:
                      type: integer
                      description: Currency ID.
                    time_profiles_id:
                      type: array
                      items:
                        type: integer
                      description: Time profile ID.
                    tag:
                      type: array
                      items:
                        type: string
                      description: Rate tag.
                    pay_setup:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: Setup fee.
                    value:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: Rate value.
                    end_date:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: string
                        format: date-time
                      example:
                      - '2025-06-10T10:00:00.000Z'
                      - '2025-07-02T16:00:00.000Z'
                      description: End date.
                    min_volume:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: integer
                      example:
                      - 1
                      - 9
                      description: Minimum billed volume.
                    pay_interval:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: integer
                      example:
                      - 1
                      - 9
                      description: Pay interval.
                    grace_volume:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: integer
                      example:
                      - 1
                      - 9
                      description: Grace volume.
                    num_length_max_lte:
                      type: integer
                      minimum: 1
                      description: Maximum destination number length.
                    num_length_min_gte:
                      type: integer
                      minimum: 1
                      description: Minimum destination number length.
                    notes:
                      type: string
                      description: Rate notes.
                    blocked:
                      type: boolean
                      description: If `True`, return only blocked rates.
                    next_rates_diff_status:
                      type: string
                      enum:
                      - new
                      - increased
                      - decreased
                      - unchanged
                      - blocked
                      description: Status of the next rate.
                    prev_rates_diff_status:
                      type: string
                      enum:
                      - new
                      - increased
                      - decreased
                      - unchanged
                      - blocked
                      description: Status of the previous rate.
                    notification_status:
                      type: string
                      enum:
                      - sent
                      - not_sent
                      description: Rate notification status at the timestamp given
                        in `notification_dt` field.
                    notification_dt:
                      type: string
                      format: date-time
                      description: Timestamp to be used in conjunction with `notification_status`
                        field to define the timestamp at which the rate notification
                        status should be checked.
                    rates_id:
                      type: integer
                      description: Special rate ID (to find related children rates).
                    rate_tables_logs_id:
                      type: integer
                      description: Rate table log ID (to filter rates from the specific
                        import).
                  required: []
                  dependentRequired:
                    notification_status:
                    - notification_dt
                  description: Filter parameters.
                effective_from:
                  type: string
                  format: date-time
                  description: Effective date to set.
                end_date:
                  type: string
                  format: date-time
                  description: End date to set.
                grace_volume:
                  type: integer
                  minimum: 0
                  description: Grace volume to set.
                min_volume:
                  type: integer
                  minimum: 1
                  description: Minimum billed volume to set.
                num_length_max:
                  type: integer
                  minimum: 1
                  description: Maximum number length to set.
                num_length_min:
                  type: integer
                  minimum: 1
                  description: Minimum number length to set.
                pay_interval:
                  type: integer
                  minimum: 1
                  description: Payment interval to set.
                pay_setup:
                  type: number
                  format: decimal
                  description: Setup fee value, check `pay_setup_changes` and `pay_setup_type`
                    for the logic of the changes applied.
                pay_setup_type:
                  type: string
                  enum:
                  - abs
                  - rel
                  description: Setup fee value type. If `abs` the value will be taken
                    as absolute, if `rel` - as percentage of the matched rate.
                  default: abs
                pay_setup_changes:
                  type: string
                  enum:
                  - none
                  - set
                  - inc
                  - dec
                  description: Setup fee change direction. If `inc` the value will
                    be increased, if `dec` - decreased, if `set` - set to the given
                    value.
                  default: none
                status:
                  type: string
                  enum:
                  - active
                  - stashed
                  description: Status to set.
                tag:
                  type: string
                  description: Tag to set.
                time_profiles_id:
                  type: integer
                  description: Time profiles ID to set.
                value:
                  type: number
                  format: decimal
                  description: Rate value, check `value_changes` and `value_type`
                    for the logic of the changes applied.
                value_type:
                  type: string
                  enum:
                  - abs
                  - rel
                  description: Rate value type. If `abs` the value will be taken as
                    absolute, if `rel` - as percentage of the matched rate.
                  default: abs
                value_changes:
                  type: string
                  enum:
                  - none
                  - set
                  - inc
                  - dec
                  description: Rate value change direction. If `inc` the value will
                    be increased, if `dec` - decreased, if `set` - set to the given
                    value.
                  default: none
                notes:
                  type: string
                  description: Notes to set.
              required:
              - action
              - search
              dependentRequired: {}
  /rates/bulk/preview:
    get:
      tags:
      - rates
      operationId: rates.update_bulk_preview
      summary: Update rates by filter (preview)
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of rate objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        rates.update_bulk_preview

        :::


        The method returns rates as they would be after the update.


        :::info

        If any of the new values is not set, it will be left unchanged.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                search:
                  type: object
                  properties:
                    limit:
                      type: integer
                      description: Number of rows to return (for pagination).
                      default: 20
                    offset:
                      type: integer
                      description: Number of rows to skip (for pagination).
                      default: 0
                    order:
                      type: array
                      items:
                        type: string
                        enum:
                        - code
                        - -code
                        - currencies_id
                        - -currencies_id
                        - effective_from
                        - -effective_from
                        - effective_till
                        - -effective_till
                        - end_date
                        - -end_date
                        - grace_volume
                        - -grace_volume
                        - id
                        - -id
                        - min_volume
                        - -min_volume
                        - notes
                        - -notes
                        - pay_interval
                        - -pay_interval
                        - pay_setup
                        - -pay_setup
                        - rate_tables_id
                        - -rate_tables_id
                        - src_code
                        - -src_code
                        - status
                        - -status
                        - tag
                        - -tag
                        - time_profiles_id
                        - -time_profiles_id
                        - value
                        - -value
                      description: List of columns to order results by.
                      default: []
                    rate_tables_id:
                      type: integer
                      description: Rate table ID.
                    state:
                      type: string
                      enum:
                      - current_future
                      - current
                      - future
                      - past
                      - all
                      description: Timeline state of the rate at the timestamp given
                        in `dt` field.
                      default: current_future
                    dt:
                      type: string
                      format: date-time
                      description: Timestamp to be used in conjunction with `state`
                        field to define the timestamp at which the rate state should
                        be checked.
                    q:
                      type: string
                      description: Quick search (wildcards allowed).
                    code:
                      type: string
                      maxLength: 64
                      description: Destination code (wildcards allowed).
                    code_in:
                      type: array
                      items:
                        type: string
                        maxLength: 64
                      description: Destination codes list.
                    code_like:
                      type: string
                      description: Search by destination code or code name at the
                        same time (wildcards allowed). Use with caution, depending
                        on the state of other filters may by result consuming.
                    code_name:
                      type: string
                      description: Destination code name (wildcards allowed).
                    src_code:
                      type: string
                      maxLength: 64
                      description: Source code (wildcards allowed).
                    src_code_in:
                      type: array
                      items:
                        type: string
                        maxLength: 64
                      description: Source codes list.
                    src_code_name:
                      type: string
                      description: Source code name (wildcards allowed).
                    id:
                      type: array
                      items:
                        type: integer
                      description: Rate ID.
                    status:
                      type: string
                      enum:
                      - active
                      - stashed
                      description: Rate status.
                    currencies_id:
                      type: integer
                      description: Currency ID.
                    time_profiles_id:
                      type: array
                      items:
                        type: integer
                      description: Time profile ID.
                    tag:
                      type: array
                      items:
                        type: string
                      description: Rate tag.
                    pay_setup:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: Setup fee.
                    value:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: Rate value.
                    end_date:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: string
                        format: date-time
                      example:
                      - '2025-06-10T10:00:00.000Z'
                      - '2025-07-02T16:00:00.000Z'
                      description: End date.
                    min_volume:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: integer
                      example:
                      - 1
                      - 9
                      description: Minimum billed volume.
                    pay_interval:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: integer
                      example:
                      - 1
                      - 9
                      description: Pay interval.
                    grace_volume:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: integer
                      example:
                      - 1
                      - 9
                      description: Grace volume.
                    num_length_max_lte:
                      type: integer
                      minimum: 1
                      description: Maximum destination number length.
                    num_length_min_gte:
                      type: integer
                      minimum: 1
                      description: Minimum destination number length.
                    notes:
                      type: string
                      description: Rate notes.
                    blocked:
                      type: boolean
                      description: If `True`, return only blocked rates.
                    next_rates_diff_status:
                      type: string
                      enum:
                      - new
                      - increased
                      - decreased
                      - unchanged
                      - blocked
                      description: Status of the next rate.
                    prev_rates_diff_status:
                      type: string
                      enum:
                      - new
                      - increased
                      - decreased
                      - unchanged
                      - blocked
                      description: Status of the previous rate.
                    notification_status:
                      type: string
                      enum:
                      - sent
                      - not_sent
                      description: Rate notification status at the timestamp given
                        in `notification_dt` field.
                    notification_dt:
                      type: string
                      format: date-time
                      description: Timestamp to be used in conjunction with `notification_status`
                        field to define the timestamp at which the rate notification
                        status should be checked.
                    rates_id:
                      type: integer
                      description: Special rate ID (to find related children rates).
                    rate_tables_logs_id:
                      type: integer
                      description: Rate table log ID (to filter rates from the specific
                        import).
                  required: []
                  dependentRequired:
                    notification_status:
                    - notification_dt
                  description: Filter parameters.
                effective_from:
                  type: string
                  format: date-time
                  description: Effective date to set.
                end_date:
                  type: string
                  format: date-time
                  description: End date to set.
                grace_volume:
                  type: integer
                  minimum: 0
                  description: Grace volume to set.
                min_volume:
                  type: integer
                  minimum: 1
                  description: Minimum billed volume to set.
                num_length_max:
                  type: integer
                  minimum: 1
                  description: Maximum number length to set.
                num_length_min:
                  type: integer
                  minimum: 1
                  description: Minimum number length to set.
                pay_interval:
                  type: integer
                  minimum: 1
                  description: Payment interval to set.
                pay_setup:
                  type: number
                  format: decimal
                  description: Setup fee value, check `pay_setup_changes` and `pay_setup_type`
                    for the logic of the changes applied.
                pay_setup_type:
                  type: string
                  enum:
                  - abs
                  - rel
                  description: Setup fee value type. If `abs` the value will be taken
                    as absolute, if `rel` - as percentage of the matched rate.
                  default: abs
                pay_setup_changes:
                  type: string
                  enum:
                  - none
                  - set
                  - inc
                  - dec
                  description: Setup fee change direction. If `inc` the value will
                    be increased, if `dec` - decreased, if `set` - set to the given
                    value.
                  default: none
                status:
                  type: string
                  enum:
                  - active
                  - stashed
                  description: Status to set.
                tag:
                  type: string
                  description: Tag to set.
                time_profiles_id:
                  type: integer
                  description: Time profiles ID to set.
                value:
                  type: number
                  format: decimal
                  description: Rate value, check `value_changes` and `value_type`
                    for the logic of the changes applied.
                value_type:
                  type: string
                  enum:
                  - abs
                  - rel
                  description: Rate value type. If `abs` the value will be taken as
                    absolute, if `rel` - as percentage of the matched rate.
                  default: abs
                value_changes:
                  type: string
                  enum:
                  - none
                  - set
                  - inc
                  - dec
                  description: Rate value change direction. If `inc` the value will
                    be increased, if `dec` - decreased, if `set` - set to the given
                    value.
                  default: none
                notes:
                  type: string
                  description: Notes to set.
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - code
                    - -code
                    - currencies_id
                    - -currencies_id
                    - effective_from
                    - -effective_from
                    - effective_till
                    - -effective_till
                    - end_date
                    - -end_date
                    - grace_volume
                    - -grace_volume
                    - id
                    - -id
                    - min_volume
                    - -min_volume
                    - notes
                    - -notes
                    - pay_interval
                    - -pay_interval
                    - pay_setup
                    - -pay_setup
                    - rate_tables_id
                    - -rate_tables_id
                    - src_code
                    - -src_code
                    - status
                    - -status
                    - tag
                    - -tag
                    - time_profiles_id
                    - -time_profiles_id
                    - value
                    - -value
                  default: []
                  description: List of columns to order results by.
              required:
              - search
              dependentRequired: {}
  /rates/agreements:
    post:
      tags:
      - rates.agreements
      operationId: rates.agreements.create
      summary: Create agreement
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Rates agreement object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ":::note[JSON-RPC]\nrates.agreements.create\n:::\n\n:::info Delay\
        \ types\nAll `xyz_delay_type` fields could have one of the values:\n    *\
        \ `days` - days from midnight\n    * `days_current` - days from notification\n\
        \    * `hours` - hours from XX:00 (where XX is an hour of notification)\n\
        \    * `hours_current` - hours from notification\n:::"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 0
                  maxLength: 128
                  description: Name.
                companies_id:
                  type: integer
                  description: Partition ID.
                increase_delay_value:
                  type: integer
                  minimum: 0
                  maximum: 365
                  description: 'Rate increase: notice period value.'
                increase_delay_type:
                  type: string
                  enum:
                  - days
                  - days_current
                  - hours
                  - hours_current
                  description: 'Rate increase: notice period type.'
                decrease_delay_value:
                  type: integer
                  minimum: 0
                  maximum: 365
                  description: 'Rate decrease: notice period value.'
                decrease_delay_type:
                  type: string
                  enum:
                  - days
                  - days_current
                  - hours
                  - hours_current
                  description: 'Rate decrease: notice period type.'
                unchanged_delay_value:
                  type: integer
                  minimum: 0
                  maximum: 365
                  description: 'Unchanged rate: notice period value.'
                unchanged_delay_type:
                  type: string
                  enum:
                  - days
                  - days_current
                  - hours
                  - hours_current
                  description: 'Unchanged rate: notice period type.'
                new_delay_value:
                  type: integer
                  minimum: 0
                  maximum: 365
                  description: 'New rate: notice period value.'
                new_delay_type:
                  type: string
                  enum:
                  - days
                  - days_current
                  - hours
                  - hours_current
                  description: 'New rate: notice period type.'
                close_delay_value:
                  type: integer
                  minimum: 0
                  maximum: 365
                  description: 'Closed rate: notice period value.'
                close_delay_type:
                  type: string
                  enum:
                  - days
                  - days_current
                  - hours
                  - hours_current
                  description: 'Closed rate: notice period type.'
                block_delay_value:
                  type: integer
                  minimum: 0
                  maximum: 365
                  description: 'Blocked rate: notice period value.'
                block_delay_type:
                  type: string
                  enum:
                  - days
                  - days_current
                  - hours
                  - hours_current
                  description: 'Blocked rate: notice period type.'
                weekday:
                  type:
                  - string
                  - 'null'
                  enum:
                  - mo
                  - tu
                  - we
                  - th
                  - fr
                  - sa
                  - su
                  default: null
                  description: Notification day of the week.
                sort:
                  type: integer
                  minimum: -2147483647
                  maximum: 2147483647
                  default: 100
                  description: Sort order (used for options sorting in the UI).
              required:
              - name
              - companies_id
              - increase_delay_value
              - increase_delay_type
              - decrease_delay_value
              - decrease_delay_type
              - unchanged_delay_value
              - unchanged_delay_type
              - new_delay_value
              - new_delay_type
              - close_delay_value
              - close_delay_type
              - block_delay_value
              - block_delay_type
              dependentRequired: {}
    get:
      tags:
      - rates.agreements
      operationId: rates.agreements.search
      summary: List agreements
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of rate agreement objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        rates.agreements.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - block_delay_type
                    - -block_delay_type
                    - block_delay_value
                    - -block_delay_value
                    - close_delay_type
                    - -close_delay_type
                    - close_delay_value
                    - -close_delay_value
                    - companies_id
                    - -companies_id
                    - decrease_delay_type
                    - -decrease_delay_type
                    - decrease_delay_value
                    - -decrease_delay_value
                    - id
                    - -id
                    - increase_delay_type
                    - -increase_delay_type
                    - increase_delay_value
                    - -increase_delay_value
                    - name
                    - -name
                    - new_delay_type
                    - -new_delay_type
                    - new_delay_value
                    - -new_delay_value
                    - sort
                    - -sort
                    - unchanged_delay_type
                    - -unchanged_delay_type
                    - unchanged_delay_value
                    - -unchanged_delay_value
                    - weekday
                    - -weekday
                  default: []
                  description: List of columns to order results by.
                id:
                  type: integer
                  description: Rate agreement ID.
                companies_id:
                  type: array
                  items:
                    type: integer
                  description: Partition ID.
                name:
                  type: string
                  description: Name.
                weekday:
                  type: string
                  enum:
                  - mo
                  - tu
                  - we
                  - th
                  - fr
                  - sa
                  - su
                  description: Notification day of the week.
                increase_delay_value:
                  type: integer
                  minimum: 0
                  maximum: 365
                  description: 'Rate increase: notice period value.'
                increase_delay_type:
                  type: string
                  enum:
                  - days
                  - days_current
                  - hours
                  - hours_current
                  description: 'Rate increase: notice period type.'
                decrease_delay_value:
                  type: integer
                  minimum: 0
                  maximum: 365
                  description: 'Rate decrease: notice period value.'
                decrease_delay_type:
                  type: string
                  enum:
                  - days
                  - days_current
                  - hours
                  - hours_current
                  description: 'Rate decrease: notice period type.'
                unchanged_delay_value:
                  type: integer
                  minimum: 0
                  maximum: 365
                  description: 'Unchanged rate: notice period value.'
                unchanged_delay_type:
                  type: string
                  enum:
                  - days
                  - days_current
                  - hours
                  - hours_current
                  description: 'Unchanged rate: notice period type.'
                new_delay_value:
                  type: integer
                  minimum: 0
                  maximum: 365
                  description: 'New rate: notice period value.'
                new_delay_type:
                  type: string
                  enum:
                  - days
                  - days_current
                  - hours
                  - hours_current
                  description: 'New rate: notice period type.'
                close_delay_value:
                  type: integer
                  minimum: 0
                  maximum: 365
                  description: 'Closed rate: notice period value.'
                close_delay_type:
                  type: string
                  enum:
                  - days
                  - days_current
                  - hours
                  - hours_current
                  description: 'Closed rate: notice period type.'
                block_delay_value:
                  type: integer
                  minimum: 0
                  maximum: 365
                  description: 'Blocked rate: notice period value.'
                block_delay_type:
                  type: string
                  enum:
                  - days
                  - days_current
                  - hours
                  - hours_current
                  description: 'Blocked rate: notice period type.'
              required: []
              dependentRequired: {}
  /rates/agreements/{id}:
    delete:
      tags:
      - rates.agreements
      operationId: rates.agreements.delete
      summary: Delete agreement
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Rate agreement ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        rates.agreements.delete

        :::


        '
    get:
      tags:
      - rates.agreements
      operationId: rates.agreements.get
      summary: Get agreement
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Agreement ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Rate agreement object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        rates.agreements.get

        :::


        '
    patch:
      tags:
      - rates.agreements
      operationId: rates.agreements.update
      summary: Update agreement
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Rate agreement ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        rates.agreements.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 0
                  maxLength: 128
                  description: Name.
                companies_id:
                  type: integer
                  description: Partition ID.
                increase_delay_value:
                  type: integer
                  minimum: 0
                  maximum: 365
                  description: 'Rate increase: notice period value.'
                increase_delay_type:
                  type: string
                  enum:
                  - days
                  - days_current
                  - hours
                  - hours_current
                  description: 'Rate increase: notice period type.'
                decrease_delay_value:
                  type: integer
                  minimum: 0
                  maximum: 365
                  description: 'Rate decrease: notice period value.'
                decrease_delay_type:
                  type: string
                  enum:
                  - days
                  - days_current
                  - hours
                  - hours_current
                  description: 'Rate decrease: notice period type.'
                unchanged_delay_value:
                  type: integer
                  minimum: 0
                  maximum: 365
                  description: 'Unchanged rate: notice period value.'
                unchanged_delay_type:
                  type: string
                  enum:
                  - days
                  - days_current
                  - hours
                  - hours_current
                  description: 'Unchanged rate: notice period type.'
                new_delay_value:
                  type: integer
                  minimum: 0
                  maximum: 365
                  description: 'New rate: notice period value.'
                new_delay_type:
                  type: string
                  enum:
                  - days
                  - days_current
                  - hours
                  - hours_current
                  description: 'New rate: notice period type.'
                close_delay_value:
                  type: integer
                  minimum: 0
                  maximum: 365
                  description: 'Closed rate: notice period value.'
                close_delay_type:
                  type: string
                  enum:
                  - days
                  - days_current
                  - hours
                  - hours_current
                  description: 'Closed rate: notice period type.'
                block_delay_value:
                  type: integer
                  minimum: 0
                  maximum: 365
                  description: 'Blocked rate: notice period value.'
                block_delay_type:
                  type: string
                  enum:
                  - days
                  - days_current
                  - hours
                  - hours_current
                  description: 'Blocked rate: notice period type.'
                weekday:
                  type:
                  - string
                  - 'null'
                  enum:
                  - mo
                  - tu
                  - we
                  - th
                  - fr
                  - sa
                  - su
                  default: null
                  description: Notification day of the week.
                sort:
                  type: integer
                  minimum: -2147483647
                  maximum: 2147483647
                  default: 100
                  description: Sort order (used for options sorting in the UI).
              required:
              - name
              - companies_id
              - increase_delay_value
              - increase_delay_type
              - decrease_delay_value
              - decrease_delay_type
              - unchanged_delay_value
              - unchanged_delay_type
              - new_delay_value
              - new_delay_type
              - close_delay_value
              - close_delay_type
              - block_delay_value
              - block_delay_type
              dependentRequired: {}
  /rates/analysis:
    post:
      tags:
      - rates.analysis
      operationId: rates.analysis.query
      summary: Query analysis
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Object containing structured report results.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        rates.analysis.query

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                services_id:
                  type: integer
                  description: 'Filter: service ID.'
                sources:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                        - clients
                        - accounts
                        - rate_tables
                        description: Source type.
                      id:
                        type: integer
                        description: Source ID, according to the type.
                    required:
                    - type
                    - id
                    dependentRequired: {}
                  description: 'Filter: list of sources to analyze. If defined as
                    client or account,

                    termination rates will be used for comparison.'
                dst_filters:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                        - code
                        - code_name
                        - code_country
                        description: Filter type.
                      value:
                        type: string
                        description: Filter value, wildcards allowed.
                    required:
                    - type
                    - value
                    dependentRequired: {}
                  description: 'Filter: list of filters for destinations.'
                currencies_id:
                  type: integer
                  description: 'Output: currency ID to convert rates to.'
                tags:
                  type:
                  - array
                  - 'null'
                  items:
                    type: string
                  default: null
                  description: 'Filter: match rates and rate tables with given tags.
                    If some of

                    the sources don''t have rate or rate table with given tags, the
                    default

                    tag `@` will be used.'
                master:
                  type:
                  - object
                  - 'null'
                  properties:
                    type:
                      type: string
                      enum:
                      - clients
                      - accounts
                      - rate_tables
                      description: Source type.
                    id:
                      type: integer
                      description: Source ID, according to the type.
                  required:
                  - type
                  - id
                  dependentRequired: {}
                  default: null
                  description: 'Master source for comparison. If defined as client
                    or account,

                    origination rates will be used for comparison.'
                actual_on:
                  type:
                  - string
                  - 'null'
                  format: date-time
                  default: null
                  description: 'Timestamp at which rates should be effective. If not
                    given,

                    current time will be used.'
                volume_interval:
                  type:
                  - string
                  - 'null'
                  format: duration
                  default: null
                  description: 'Time interval to use for calculation of the

                    statistical data (e.g. volumes, profit).'
                return_fields:
                  type:
                  - array
                  - 'null'
                  items:
                    type: string
                    enum:
                    - master_routes_qty
                    - sources_quality
                    - master_profit
                    - master_volume
                    - sources_volume
                  default: null
                  description: 'Output: list of additional fields to return.'
                order:
                  type:
                  - array
                  - 'null'
                  items:
                    type: string
                    enum:
                    - code
                    - -code
                    - code_country
                    - -code_country
                    - code_name
                    - -code_name
                    - master.profit.abs
                    - -master.profit.abs
                    - master.volume.abs
                    - -master.volume.abs
                    - sources_volume.abs
                    - -sources_volume.abs
                  default: null
                  description: 'Output: list of columns to order results by.'
                code_decks_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Output: code deck ID to return names by.'
                group_by:
                  type: string
                  enum:
                  - code
                  - code_name
                  default: code
                  description: 'Output: results grouping.'
              required:
              - services_id
              - sources
              - dst_filters
              - currencies_id
              dependentRequired: {}
  /rates/exports/templates:
    post:
      tags:
      - rates.exports.templates
      operationId: rates.exports.templates.create
      summary: Create template
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Export template object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        rates.exports.templates.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 0
                  maxLength: 128
                  description: Name.
                companies_id:
                  type: integer
                  description: Partition ID.
                data:
                  type: object
                  properties:
                    file_format:
                      type: string
                      enum:
                      - csv
                      - xlsx
                      description: File format.
                    columns:
                      type: array
                      items:
                        type: string
                        enum:
                        - src_code
                        - src_code_name
                        - code
                        - code_name
                        - effective_from
                        - value
                        - billing_increment
                        - min_volume
                        - pay_interval
                        - grace_volume
                        - pay_setup
                        - time_profile
                        - end_date
                        - num_length_min
                        - num_length_max
                        - prev_rates_value
                        - prev_rates_diff
                        - prev_rates_diff_status
                        - prev_rates_export_diff
                        - prev_rates_export_diff_status
                        - notes
                        - tag
                        - status
                        - tech_prefix
                      description: Columns to export in required order.
                    file_compress:
                      type: boolean
                      description: If `True`, the file will be compressed to ZIP archive.
                      default: false
                    delimiter:
                      type: string
                      maxLength: 1
                      description: Column delimiter. For `csv` format only.
                      default: ','
                    with_header_row:
                      type: boolean
                      description: If `True`, the file will contain header row.
                      default: false
                    header:
                      type: string
                      description: Additional information to include in the header.
                      default: ''
                    footer:
                      type: string
                      description: Additional information to include in the footer.
                      default: ''
                    code_decks_id:
                      type:
                      - integer
                      - 'null'
                      description: Code deck ID to use for destination codes.
                      default: null
                    src_code_decks_id:
                      type:
                      - integer
                      - 'null'
                      description: Source code deck ID to use for source codes.
                      default: null
                    normalize:
                      type: boolean
                      description: If `True`, only codes that exist in selected code
                        deck will be exported.
                      default: false
                    codes_output:
                      type: string
                      enum:
                      - separate
                      - grouped
                      - ranged
                      description: Codes presentation format.
                      default: separate
                    date_format:
                      type:
                      - string
                      - 'null'
                      description: Date format to use for timestamps output. In `strftime`
                        format.
                      default: null
                    billing_increment_format:
                      type:
                      - array
                      - 'null'
                      items:
                        type: string
                        enum:
                        - grace_volume
                        - pay_interval
                        - min_volume
                      description: List of parameters to output in the "Billing increment"
                        column.
                      default: null
                  required:
                  - file_format
                  - columns
                  dependentRequired: {}
                  description: Template settings.
              required:
              - name
              - companies_id
              - data
              dependentRequired: {}
    get:
      tags:
      - rates.exports.templates
      operationId: rates.exports.templates.search
      summary: List templates
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of export template objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        rates.exports.templates.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - id
                    - -id
                    - name
                    - -name
                  default: []
                  description: List of columns to order results by.
                id:
                  type: array
                  items:
                    type: integer
                  description: Export template ID.
                name:
                  type: string
                  description: Name (wildcards allowed).
                companies_id:
                  type: array
                  items:
                    type: integer
                  description: Partition ID.
              required: []
              dependentRequired: {}
  /rates/exports/templates/{id}:
    delete:
      tags:
      - rates.exports.templates
      operationId: rates.exports.templates.delete
      summary: Delete template
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Export template ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        rates.exports.templates.delete

        :::


        '
    get:
      tags:
      - rates.exports.templates
      operationId: rates.exports.templates.get
      summary: Get template
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Export template ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Export template object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        rates.exports.templates.get

        :::


        '
    patch:
      tags:
      - rates.exports.templates
      operationId: rates.exports.templates.update
      summary: Update template
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Rate export template ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        rates.exports.templates.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 0
                  maxLength: 128
                  description: Name.
                companies_id:
                  type: integer
                  description: Partition ID.
                data:
                  type: object
                  properties:
                    file_format:
                      type: string
                      enum:
                      - csv
                      - xlsx
                      description: File format.
                    columns:
                      type: array
                      items:
                        type: string
                        enum:
                        - src_code
                        - src_code_name
                        - code
                        - code_name
                        - effective_from
                        - value
                        - billing_increment
                        - min_volume
                        - pay_interval
                        - grace_volume
                        - pay_setup
                        - time_profile
                        - end_date
                        - num_length_min
                        - num_length_max
                        - prev_rates_value
                        - prev_rates_diff
                        - prev_rates_diff_status
                        - prev_rates_export_diff
                        - prev_rates_export_diff_status
                        - notes
                        - tag
                        - status
                        - tech_prefix
                      description: Columns to export in required order.
                    file_compress:
                      type: boolean
                      description: If `True`, the file will be compressed to ZIP archive.
                      default: false
                    delimiter:
                      type: string
                      maxLength: 1
                      description: Column delimiter. For `csv` format only.
                      default: ','
                    with_header_row:
                      type: boolean
                      description: If `True`, the file will contain header row.
                      default: false
                    header:
                      type: string
                      description: Additional information to include in the header.
                      default: ''
                    footer:
                      type: string
                      description: Additional information to include in the footer.
                      default: ''
                    code_decks_id:
                      type:
                      - integer
                      - 'null'
                      description: Code deck ID to use for destination codes.
                      default: null
                    src_code_decks_id:
                      type:
                      - integer
                      - 'null'
                      description: Source code deck ID to use for source codes.
                      default: null
                    normalize:
                      type: boolean
                      description: If `True`, only codes that exist in selected code
                        deck will be exported.
                      default: false
                    codes_output:
                      type: string
                      enum:
                      - separate
                      - grouped
                      - ranged
                      description: Codes presentation format.
                      default: separate
                    date_format:
                      type:
                      - string
                      - 'null'
                      description: Date format to use for timestamps output. In `strftime`
                        format.
                      default: null
                    billing_increment_format:
                      type:
                      - array
                      - 'null'
                      items:
                        type: string
                        enum:
                        - grace_volume
                        - pay_interval
                        - min_volume
                      description: List of parameters to output in the "Billing increment"
                        column.
                      default: null
                  required:
                  - file_format
                  - columns
                  dependentRequired: {}
                  description: Template settings.
              required:
              - name
              - companies_id
              - data
              dependentRequired: {}
  /rates/generators/{id}:
    get:
      tags:
      - rates.generators
      operationId: rates.generators.get
      summary: Get generator
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Rate generator ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Rate generator object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        rates.generators.get

        :::


        '
  /rates/generators:
    get:
      tags:
      - rates.generators
      operationId: rates.generators.search
      summary: List generators
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of rate generator objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        rates.generators.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - description
                    - -description
                    - id
                    - -id
                    - name
                    - -name
                    - tag
                    - -tag
                  default: []
                  description: List of columns to order results by.
                q:
                  type: string
                  description: Quick search (wildcards allowed).
                id:
                  type: array
                  items:
                    type: integer
                  description: Rate generator ID.
                companies_id:
                  type: array
                  items:
                    type: integer
                  description: Partition ID.
              required: []
              dependentRequired: {}
  /rates/generators/queue:
    post:
      tags:
      - rates.generators.queue
      operationId: rates.generators.queue.enqueue
      summary: Enqueue generator
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: None on success. Error is raised otherwise.
          content:
            application/json:
              schema:
                type: 'null'
      description: ':::note[JSON-RPC]

        rates.generators.queue.enqueue

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                rates_generators_id:
                  type: integer
                  minimum: 0
                  description: Rate generator ID to use for generation.
                rate_tables_id:
                  type:
                  - integer
                  - 'null'
                  minimum: 0
                  default: null
                  description: Rate table ID to update.
              required:
              - rates_generators_id
              dependentRequired: {}
  /rates/imports/{import_queue_id}/enqueue:
    post:
      tags:
      - rates.imports
      operationId: rates.imports.enqueue
      summary: Enqueue
      parameters:
      - in: path
        name: import_queue_id
        schema:
          type: integer
        required: true
        description: Import queue item ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: None on success. Error is raised otherwise.
          content:
            application/json:
              schema:
                type: 'null'
      description: ':::note[JSON-RPC]

        rates.imports.enqueue

        :::


        This method is the second step of the import process. It puts import queue

        item into enqueued state and starts the import. Use "Prepare rate import"

        method first to create the import queue item.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                import_templates_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Import template ID to use for import. Either

                    `settings` or `import_templates_id` should be provided.'
                settings:
                  type:
                  - object
                  - 'null'
                  properties:
                    unchanged_mode:
                      type: string
                      enum:
                      - save_rows
                      - skip_rows
                      description: Mode of handling unchanged rates.
                      default: skip_rows
                    warning_mode:
                      type: string
                      enum:
                      - save_rows
                      - skip_rows
                      - abort
                      description: Mode of handling rates with warnings.
                      default: save_rows
                    error_mode:
                      type: string
                      enum:
                      - skip_rows
                      - abort
                      description: Mode of handling rates with errors.
                      default: skip_rows
                    datetime_format:
                      type: string
                      enum:
                      - mdy
                      - dmy
                      - ymd
                      description: Expected date format for timestamps.
                      default: mdy
                    billing_increment_format:
                      type:
                      - array
                      - 'null'
                      items:
                        type: string
                        enum:
                        - min_volume
                        - pay_interval
                        - grace_volume
                      description: List and order of parameters in the "Billing increment"
                        column.
                      default: null
                    skip_dash:
                      type: boolean
                      description: If `True`, the dashes used in the code definitions
                        will be removed (e.g. "301-303" will be imported as "301303").
                        Otherwise the code will be treated as a range (e.g. "301-303"
                        will be imported as "301", "302" and "303").
                      default: false
                    split_src_code_name:
                      type: boolean
                      description: If `True`, the value in the "Src Code Name" column
                        will be split by underscore and the last part will be used
                        as a src code name.
                      default: false
                    blocked_keywords:
                      type: array
                      items:
                        type: string
                      description: List of keywords to treat as "blocked" rates.
                      default: []
                    closed_keywords:
                      type: array
                      items:
                        type: string
                      description: List of keywords to treat as "closed" rates.
                      default: []
                    code_deck_mode:
                      type:
                      - string
                      - 'null'
                      enum:
                      - new
                      - replace
                      - all
                      description: Mode of code deck updating.
                      default: null
                    code_decks_id:
                      type:
                      - integer
                      - 'null'
                      description: Code deck ID to use for destination codes.
                      default: null
                    src_code_decks_id:
                      type:
                      - integer
                      - 'null'
                      description: Source code deck ID to use for source codes.
                      default: null
                    az_mode:
                      type:
                      - string
                      - 'null'
                      enum:
                      - simple
                      - extended
                      description: 'A-Z processing: processing mode. In `simple` mode
                        all active rates will be closed according to the interval
                        provided by `az_interval_value` and `az_interval_type` parameters.
                        In `extended` mode all future rates, that are not present
                        within imported file will be moved to `stashed` status, all
                        active rates will be handled in the same way as in `simple`
                        mode.'
                      default: null
                    az_codes:
                      type:
                      - array
                      - 'null'
                      items:
                        type: string
                      description: 'A-Z processing: list of codes to be handled.'
                      default: null
                    az_interval_value:
                      type:
                      - integer
                      - 'null'
                      description: 'A-Z processing: interval value for closing rates.'
                      default: null
                    az_interval_type:
                      type: string
                      enum:
                      - days
                      - days_current
                      - hours
                      - hours_current
                      description: 'A-Z processing: interval type for closing rates.'
                      default: days
                    agreements_tolerance:
                      type:
                      - integer
                      - 'null'
                      minimum: 0
                      description: 'Analysis: if effective date of the rate is different
                        than the date estimated by the agreement by more than given
                        tolerance, an alert will be generated. Given in days.'
                      default: null
                    total_changes_threshold:
                      type:
                      - integer
                      - 'null'
                      minimum: 0
                      description: 'Analysis: if total number of rates with changes
                        is more than given value, an alert will be generated. Given
                        in number of rates.'
                      default: null
                    rate_deviation_tolerance:
                      type:
                      - integer
                      - 'null'
                      minimum: 0
                      description: 'Analysis: if rate value change is more than given
                        value, an alert will be generated. Given in percentage.'
                      default: null
                    billing_increment_check:
                      type: boolean
                      description: 'Analysis: if billing increment is different from
                        the previous billing increment, an alert will be generated.'
                      default: false
                    sheets:
                      type: array
                      items:
                        type: object
                        properties:
                          type:
                            type:
                            - string
                            - 'null'
                            enum:
                            - rates
                            - src_codes
                            - dst_codes
                            description: Type of the sheet.
                            default: null
                          skip_rows_top:
                            type: integer
                            description: Number of rows to skip at the top of the
                              sheet.
                            default: 0
                          skip_rows_bottom:
                            type: integer
                            description: Number of rows to skip at the bottom of the
                              sheet.
                            default: 0
                          columns:
                            description: List of columns in the sheet in their exact
                              order. Should be given as an array, where each item
                              represents a column in the imported sheet. If column
                              has to be ignored, define it as an empty value.
                            oneOf:
                            - type: array
                              items:
                                type: string
                                enum:
                                - code
                                - code_name
                                - country_code
                                - country
                                - src_code
                                - src_code_name
                                - effective_from
                                - value
                                - billing_increment
                                - min_volume
                                - pay_interval
                                - grace_volume
                                - pay_setup
                                - time_profile
                                - end_date
                                - num_length_min
                                - num_length_max
                                - changes
                                - notes
                                - tag
                              title: rates
                            - type: array
                              items:
                                type: string
                                enum:
                                - code
                                - code_name
                              title: dst_codes
                            - type: array
                              items:
                                type: string
                                enum:
                                - code
                                - code_name
                              title: src_codes
                          code_rules:
                            description: Rules for handling absent rate parameters
                              in the sheet. The default values should be given only
                              for those columns, that are not present in the imported
                              file.
                            oneOf:
                            - type: array
                              items:
                                type: object
                                properties:
                                  code:
                                    type: string
                                    maxLength: 64
                                    description: Destination code to which the rule
                                      is applied (wildcard is allowed).
                                    default: '*'
                                  code_name:
                                    type:
                                    - string
                                    - 'null'
                                    description: Destination code name to which the
                                      rule is applied.
                                    default: null
                                  status:
                                    type: string
                                    enum:
                                    - active
                                    - stashed
                                    description: Status of the rate to be created.
                                    default: active
                                  effective_from_interval_value:
                                    type:
                                    - integer
                                    - 'null'
                                    description: 'Effective date: interval value for
                                      calculating the date.'
                                    default: null
                                  effective_from_interval_type:
                                    type: string
                                    enum:
                                    - days
                                    - days_current
                                    - hours
                                    - hours_current
                                    description: 'Effective date: interval type for
                                      calculating the date.'
                                    default: days
                                  end_date_interval_value:
                                    type:
                                    - integer
                                    - 'null'
                                    minimum: 0
                                    description: 'End date: interval value for calculating
                                      the date.'
                                    default: null
                                  end_date_interval_type:
                                    type: string
                                    enum:
                                    - days
                                    - days_current
                                    - hours
                                    - hours_current
                                    description: 'End date: interval type for calculating
                                      the date.'
                                    default: days
                                  min_volume:
                                    type: integer
                                    minimum: 0
                                    description: Minimum billing volume.
                                    default: 1
                                  pay_interval:
                                    type: integer
                                    minimum: 0
                                    description: Pay interval.
                                    default: 1
                                  grace_volume:
                                    type: integer
                                    minimum: 0
                                    description: Grace volume.
                                    default: 0
                                  pay_setup:
                                    type: number
                                    format: decimal
                                    description: Setup fee.
                                    default: 0.0
                                  time_profiles_id:
                                    type:
                                    - integer
                                    - 'null'
                                    description: Time profile ID.
                                    default: null
                                  tag:
                                    type: string
                                    description: Tag.
                                    default: '@'
                                  num_length_min:
                                    type:
                                    - integer
                                    - 'null'
                                    minimum: 1
                                    description: Minimum number length.
                                    default: null
                                  num_length_max:
                                    type:
                                    - integer
                                    - 'null'
                                    minimum: 1
                                    description: Maximum number length.
                                    default: null
                                  notes:
                                    type:
                                    - string
                                    - 'null'
                                    description: Notes.
                                    default: null
                                required: []
                                dependentRequired: {}
                              default: []
                              title: rates
                        required: []
                        dependentRequired: {}
                      description: Configuration of sheets for import.
                      default: []
                  required: []
                  dependentRequired: {}
                  default: null
                  description: 'Configuration for the import. Either `settings` or

                    `import_templates_id` should be provided.'
              required: []
              dependentRequired: {}
  /rates/imports/{import_queue_id}/status:
    get:
      tags:
      - rates.imports
      operationId: rates.imports.get_status
      summary: Get import status
      parameters:
      - in: path
        name: import_queue_id
        schema:
          type: integer
        required: true
        description: Import queue item ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: 'Object containing import status details including import queue
            item

            object, rate table log entry with statistics and list of rows which

            encountered any warning or error during the import process.'
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        rates.imports.get_status

        :::


        '
  /rates/imports:
    post:
      tags:
      - rates.imports
      operationId: rates.imports.prepare
      summary: Prepare rate import
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Import queue item object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        rates.imports.prepare

        :::


        The method is the first step of the import process. It adds import to the

        import queue and returns information about the file to be imported.


        Once the import is prepared, use "Enqueue" method to start the import.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                rate_tables_id:
                  type: integer
                  description: Rate table ID to import rates into.
                files_id:
                  type: string
                  description: 'File ID to import. Supported formats are `csv`, `xls`,
                    `xlsx`.

                    It is also possible to pass `zip` archive, which should contain
                    one

                    of the supported formats inside.'
              required:
              - rate_tables_id
              - files_id
              dependentRequired: {}
  /rates/imports/templates:
    post:
      tags:
      - rates.imports.templates
      operationId: rates.imports.templates.create
      summary: Create template
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Import template object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        rates.imports.templates.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 0
                  maxLength: 128
                  description: Name.
                companies_id:
                  type: integer
                  description: Partition ID.
                data:
                  type: object
                  properties:
                    unchanged_mode:
                      type: string
                      enum:
                      - save_rows
                      - skip_rows
                      description: Mode of handling unchanged rates.
                      default: skip_rows
                    warning_mode:
                      type: string
                      enum:
                      - save_rows
                      - skip_rows
                      - abort
                      description: Mode of handling rates with warnings.
                      default: save_rows
                    error_mode:
                      type: string
                      enum:
                      - skip_rows
                      - abort
                      description: Mode of handling rates with errors.
                      default: skip_rows
                    datetime_format:
                      type: string
                      enum:
                      - mdy
                      - dmy
                      - ymd
                      description: Expected date format for timestamps.
                      default: mdy
                    billing_increment_format:
                      type:
                      - array
                      - 'null'
                      items:
                        type: string
                        enum:
                        - min_volume
                        - pay_interval
                        - grace_volume
                      description: List and order of parameters in the "Billing increment"
                        column.
                      default: null
                    skip_dash:
                      type: boolean
                      description: If `True`, the dashes used in the code definitions
                        will be removed (e.g. "301-303" will be imported as "301303").
                        Otherwise the code will be treated as a range (e.g. "301-303"
                        will be imported as "301", "302" and "303").
                      default: false
                    split_src_code_name:
                      type: boolean
                      description: If `True`, the value in the "Src Code Name" column
                        will be split by underscore and the last part will be used
                        as a src code name.
                      default: false
                    blocked_keywords:
                      type: array
                      items:
                        type: string
                      description: List of keywords to treat as "blocked" rates.
                      default: []
                    closed_keywords:
                      type: array
                      items:
                        type: string
                      description: List of keywords to treat as "closed" rates.
                      default: []
                    code_deck_mode:
                      type:
                      - string
                      - 'null'
                      enum:
                      - new
                      - replace
                      - all
                      description: Mode of code deck updating.
                      default: null
                    code_decks_id:
                      type:
                      - integer
                      - 'null'
                      description: Code deck ID to use for destination codes.
                      default: null
                    src_code_decks_id:
                      type:
                      - integer
                      - 'null'
                      description: Source code deck ID to use for source codes.
                      default: null
                    az_mode:
                      type:
                      - string
                      - 'null'
                      enum:
                      - simple
                      - extended
                      description: 'A-Z processing: processing mode. In `simple` mode
                        all active rates will be closed according to the interval
                        provided by `az_interval_value` and `az_interval_type` parameters.
                        In `extended` mode all future rates, that are not present
                        within imported file will be moved to `stashed` status, all
                        active rates will be handled in the same way as in `simple`
                        mode.'
                      default: null
                    az_codes:
                      type:
                      - array
                      - 'null'
                      items:
                        type: string
                      description: 'A-Z processing: list of codes to be handled.'
                      default: null
                    az_interval_value:
                      type:
                      - integer
                      - 'null'
                      description: 'A-Z processing: interval value for closing rates.'
                      default: null
                    az_interval_type:
                      type: string
                      enum:
                      - days
                      - days_current
                      - hours
                      - hours_current
                      description: 'A-Z processing: interval type for closing rates.'
                      default: days
                    agreements_tolerance:
                      type:
                      - integer
                      - 'null'
                      minimum: 0
                      description: 'Analysis: if effective date of the rate is different
                        than the date estimated by the agreement by more than given
                        tolerance, an alert will be generated. Given in days.'
                      default: null
                    total_changes_threshold:
                      type:
                      - integer
                      - 'null'
                      minimum: 0
                      description: 'Analysis: if total number of rates with changes
                        is more than given value, an alert will be generated. Given
                        in number of rates.'
                      default: null
                    rate_deviation_tolerance:
                      type:
                      - integer
                      - 'null'
                      minimum: 0
                      description: 'Analysis: if rate value change is more than given
                        value, an alert will be generated. Given in percentage.'
                      default: null
                    billing_increment_check:
                      type: boolean
                      description: 'Analysis: if billing increment is different from
                        the previous billing increment, an alert will be generated.'
                      default: false
                    sheets:
                      type: array
                      items:
                        type: object
                        properties:
                          type:
                            type:
                            - string
                            - 'null'
                            enum:
                            - rates
                            - src_codes
                            - dst_codes
                            description: Type of the sheet.
                            default: null
                          skip_rows_top:
                            type: integer
                            description: Number of rows to skip at the top of the
                              sheet.
                            default: 0
                          skip_rows_bottom:
                            type: integer
                            description: Number of rows to skip at the bottom of the
                              sheet.
                            default: 0
                          columns:
                            description: List of columns in the sheet in their exact
                              order. Should be given as an array, where each item
                              represents a column in the imported sheet. If column
                              has to be ignored, define it as an empty value.
                            oneOf:
                            - type: array
                              items:
                                type: string
                                enum:
                                - code
                                - code_name
                                - country_code
                                - country
                                - src_code
                                - src_code_name
                                - effective_from
                                - value
                                - billing_increment
                                - min_volume
                                - pay_interval
                                - grace_volume
                                - pay_setup
                                - time_profile
                                - end_date
                                - num_length_min
                                - num_length_max
                                - changes
                                - notes
                                - tag
                              title: rates
                            - type: array
                              items:
                                type: string
                                enum:
                                - code
                                - code_name
                              title: dst_codes
                            - type: array
                              items:
                                type: string
                                enum:
                                - code
                                - code_name
                              title: src_codes
                          code_rules:
                            description: Rules for handling absent rate parameters
                              in the sheet. The default values should be given only
                              for those columns, that are not present in the imported
                              file.
                            oneOf:
                            - type: array
                              items:
                                type: object
                                properties:
                                  code:
                                    type: string
                                    maxLength: 64
                                    description: Destination code to which the rule
                                      is applied (wildcard is allowed).
                                    default: '*'
                                  code_name:
                                    type:
                                    - string
                                    - 'null'
                                    description: Destination code name to which the
                                      rule is applied.
                                    default: null
                                  status:
                                    type: string
                                    enum:
                                    - active
                                    - stashed
                                    description: Status of the rate to be created.
                                    default: active
                                  effective_from_interval_value:
                                    type:
                                    - integer
                                    - 'null'
                                    description: 'Effective date: interval value for
                                      calculating the date.'
                                    default: null
                                  effective_from_interval_type:
                                    type: string
                                    enum:
                                    - days
                                    - days_current
                                    - hours
                                    - hours_current
                                    description: 'Effective date: interval type for
                                      calculating the date.'
                                    default: days
                                  end_date_interval_value:
                                    type:
                                    - integer
                                    - 'null'
                                    minimum: 0
                                    description: 'End date: interval value for calculating
                                      the date.'
                                    default: null
                                  end_date_interval_type:
                                    type: string
                                    enum:
                                    - days
                                    - days_current
                                    - hours
                                    - hours_current
                                    description: 'End date: interval type for calculating
                                      the date.'
                                    default: days
                                  min_volume:
                                    type: integer
                                    minimum: 0
                                    description: Minimum billing volume.
                                    default: 1
                                  pay_interval:
                                    type: integer
                                    minimum: 0
                                    description: Pay interval.
                                    default: 1
                                  grace_volume:
                                    type: integer
                                    minimum: 0
                                    description: Grace volume.
                                    default: 0
                                  pay_setup:
                                    type: number
                                    format: decimal
                                    description: Setup fee.
                                    default: 0.0
                                  time_profiles_id:
                                    type:
                                    - integer
                                    - 'null'
                                    description: Time profile ID.
                                    default: null
                                  tag:
                                    type: string
                                    description: Tag.
                                    default: '@'
                                  num_length_min:
                                    type:
                                    - integer
                                    - 'null'
                                    minimum: 1
                                    description: Minimum number length.
                                    default: null
                                  num_length_max:
                                    type:
                                    - integer
                                    - 'null'
                                    minimum: 1
                                    description: Maximum number length.
                                    default: null
                                  notes:
                                    type:
                                    - string
                                    - 'null'
                                    description: Notes.
                                    default: null
                                required: []
                                dependentRequired: {}
                              default: []
                              title: rates
                        required: []
                        dependentRequired: {}
                      description: Configuration of sheets for import.
                      default: []
                  required: []
                  dependentRequired: {}
                  description: Template settings.
              required:
              - name
              - companies_id
              - data
              dependentRequired: {}
    get:
      tags:
      - rates.imports.templates
      operationId: rates.imports.templates.search
      summary: List templates
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of import template objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        rates.imports.templates.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - id
                    - -id
                    - name
                    - -name
                  default: []
                  description: List of columns to order results by.
                id:
                  type: array
                  items:
                    type: integer
                  description: Import template ID.
                name:
                  type: string
                  description: Name (wildcards allowed).
                companies_id:
                  type: array
                  items:
                    type: integer
                  description: Partition ID.
              required: []
              dependentRequired: {}
  /rates/imports/templates/{id}:
    delete:
      tags:
      - rates.imports.templates
      operationId: rates.imports.templates.delete
      summary: Delete template
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Import template ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        rates.imports.templates.delete

        :::


        '
    get:
      tags:
      - rates.imports.templates
      operationId: rates.imports.templates.get
      summary: Get template
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Import template ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Import template object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        rates.imports.templates.get

        :::


        '
    patch:
      tags:
      - rates.imports.templates
      operationId: rates.imports.templates.update
      summary: Update template
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Rate import template ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        rates.imports.templates.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 0
                  maxLength: 128
                  description: Name.
                companies_id:
                  type: integer
                  description: Partition ID.
                data:
                  type: object
                  properties:
                    unchanged_mode:
                      type: string
                      enum:
                      - save_rows
                      - skip_rows
                      description: Mode of handling unchanged rates.
                      default: skip_rows
                    warning_mode:
                      type: string
                      enum:
                      - save_rows
                      - skip_rows
                      - abort
                      description: Mode of handling rates with warnings.
                      default: save_rows
                    error_mode:
                      type: string
                      enum:
                      - skip_rows
                      - abort
                      description: Mode of handling rates with errors.
                      default: skip_rows
                    datetime_format:
                      type: string
                      enum:
                      - mdy
                      - dmy
                      - ymd
                      description: Expected date format for timestamps.
                      default: mdy
                    billing_increment_format:
                      type:
                      - array
                      - 'null'
                      items:
                        type: string
                        enum:
                        - min_volume
                        - pay_interval
                        - grace_volume
                      description: List and order of parameters in the "Billing increment"
                        column.
                      default: null
                    skip_dash:
                      type: boolean
                      description: If `True`, the dashes used in the code definitions
                        will be removed (e.g. "301-303" will be imported as "301303").
                        Otherwise the code will be treated as a range (e.g. "301-303"
                        will be imported as "301", "302" and "303").
                      default: false
                    split_src_code_name:
                      type: boolean
                      description: If `True`, the value in the "Src Code Name" column
                        will be split by underscore and the last part will be used
                        as a src code name.
                      default: false
                    blocked_keywords:
                      type: array
                      items:
                        type: string
                      description: List of keywords to treat as "blocked" rates.
                      default: []
                    closed_keywords:
                      type: array
                      items:
                        type: string
                      description: List of keywords to treat as "closed" rates.
                      default: []
                    code_deck_mode:
                      type:
                      - string
                      - 'null'
                      enum:
                      - new
                      - replace
                      - all
                      description: Mode of code deck updating.
                      default: null
                    code_decks_id:
                      type:
                      - integer
                      - 'null'
                      description: Code deck ID to use for destination codes.
                      default: null
                    src_code_decks_id:
                      type:
                      - integer
                      - 'null'
                      description: Source code deck ID to use for source codes.
                      default: null
                    az_mode:
                      type:
                      - string
                      - 'null'
                      enum:
                      - simple
                      - extended
                      description: 'A-Z processing: processing mode. In `simple` mode
                        all active rates will be closed according to the interval
                        provided by `az_interval_value` and `az_interval_type` parameters.
                        In `extended` mode all future rates, that are not present
                        within imported file will be moved to `stashed` status, all
                        active rates will be handled in the same way as in `simple`
                        mode.'
                      default: null
                    az_codes:
                      type:
                      - array
                      - 'null'
                      items:
                        type: string
                      description: 'A-Z processing: list of codes to be handled.'
                      default: null
                    az_interval_value:
                      type:
                      - integer
                      - 'null'
                      description: 'A-Z processing: interval value for closing rates.'
                      default: null
                    az_interval_type:
                      type: string
                      enum:
                      - days
                      - days_current
                      - hours
                      - hours_current
                      description: 'A-Z processing: interval type for closing rates.'
                      default: days
                    agreements_tolerance:
                      type:
                      - integer
                      - 'null'
                      minimum: 0
                      description: 'Analysis: if effective date of the rate is different
                        than the date estimated by the agreement by more than given
                        tolerance, an alert will be generated. Given in days.'
                      default: null
                    total_changes_threshold:
                      type:
                      - integer
                      - 'null'
                      minimum: 0
                      description: 'Analysis: if total number of rates with changes
                        is more than given value, an alert will be generated. Given
                        in number of rates.'
                      default: null
                    rate_deviation_tolerance:
                      type:
                      - integer
                      - 'null'
                      minimum: 0
                      description: 'Analysis: if rate value change is more than given
                        value, an alert will be generated. Given in percentage.'
                      default: null
                    billing_increment_check:
                      type: boolean
                      description: 'Analysis: if billing increment is different from
                        the previous billing increment, an alert will be generated.'
                      default: false
                    sheets:
                      type: array
                      items:
                        type: object
                        properties:
                          type:
                            type:
                            - string
                            - 'null'
                            enum:
                            - rates
                            - src_codes
                            - dst_codes
                            description: Type of the sheet.
                            default: null
                          skip_rows_top:
                            type: integer
                            description: Number of rows to skip at the top of the
                              sheet.
                            default: 0
                          skip_rows_bottom:
                            type: integer
                            description: Number of rows to skip at the bottom of the
                              sheet.
                            default: 0
                          columns:
                            description: List of columns in the sheet in their exact
                              order. Should be given as an array, where each item
                              represents a column in the imported sheet. If column
                              has to be ignored, define it as an empty value.
                            oneOf:
                            - type: array
                              items:
                                type: string
                                enum:
                                - code
                                - code_name
                                - country_code
                                - country
                                - src_code
                                - src_code_name
                                - effective_from
                                - value
                                - billing_increment
                                - min_volume
                                - pay_interval
                                - grace_volume
                                - pay_setup
                                - time_profile
                                - end_date
                                - num_length_min
                                - num_length_max
                                - changes
                                - notes
                                - tag
                              title: rates
                            - type: array
                              items:
                                type: string
                                enum:
                                - code
                                - code_name
                              title: dst_codes
                            - type: array
                              items:
                                type: string
                                enum:
                                - code
                                - code_name
                              title: src_codes
                          code_rules:
                            description: Rules for handling absent rate parameters
                              in the sheet. The default values should be given only
                              for those columns, that are not present in the imported
                              file.
                            oneOf:
                            - type: array
                              items:
                                type: object
                                properties:
                                  code:
                                    type: string
                                    maxLength: 64
                                    description: Destination code to which the rule
                                      is applied (wildcard is allowed).
                                    default: '*'
                                  code_name:
                                    type:
                                    - string
                                    - 'null'
                                    description: Destination code name to which the
                                      rule is applied.
                                    default: null
                                  status:
                                    type: string
                                    enum:
                                    - active
                                    - stashed
                                    description: Status of the rate to be created.
                                    default: active
                                  effective_from_interval_value:
                                    type:
                                    - integer
                                    - 'null'
                                    description: 'Effective date: interval value for
                                      calculating the date.'
                                    default: null
                                  effective_from_interval_type:
                                    type: string
                                    enum:
                                    - days
                                    - days_current
                                    - hours
                                    - hours_current
                                    description: 'Effective date: interval type for
                                      calculating the date.'
                                    default: days
                                  end_date_interval_value:
                                    type:
                                    - integer
                                    - 'null'
                                    minimum: 0
                                    description: 'End date: interval value for calculating
                                      the date.'
                                    default: null
                                  end_date_interval_type:
                                    type: string
                                    enum:
                                    - days
                                    - days_current
                                    - hours
                                    - hours_current
                                    description: 'End date: interval type for calculating
                                      the date.'
                                    default: days
                                  min_volume:
                                    type: integer
                                    minimum: 0
                                    description: Minimum billing volume.
                                    default: 1
                                  pay_interval:
                                    type: integer
                                    minimum: 0
                                    description: Pay interval.
                                    default: 1
                                  grace_volume:
                                    type: integer
                                    minimum: 0
                                    description: Grace volume.
                                    default: 0
                                  pay_setup:
                                    type: number
                                    format: decimal
                                    description: Setup fee.
                                    default: 0.0
                                  time_profiles_id:
                                    type:
                                    - integer
                                    - 'null'
                                    description: Time profile ID.
                                    default: null
                                  tag:
                                    type: string
                                    description: Tag.
                                    default: '@'
                                  num_length_min:
                                    type:
                                    - integer
                                    - 'null'
                                    minimum: 1
                                    description: Minimum number length.
                                    default: null
                                  num_length_max:
                                    type:
                                    - integer
                                    - 'null'
                                    minimum: 1
                                    description: Maximum number length.
                                    default: null
                                  notes:
                                    type:
                                    - string
                                    - 'null'
                                    description: Notes.
                                    default: null
                                required: []
                                dependentRequired: {}
                              default: []
                              title: rates
                        required: []
                        dependentRequired: {}
                      description: Configuration of sheets for import.
                      default: []
                  required: []
                  dependentRequired: {}
                  description: Template settings.
              required:
              - name
              - companies_id
              - data
              dependentRequired: {}
  /rates/special:
    post:
      tags:
      - rates.special
      operationId: rates.special.create
      summary: Create special rate
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: 'List containing the special rate created and all corresponding
            regular

            rates objects as have been stored.'
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        rates.special.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                rate_tables_id:
                  type: integer
                  description: Rate table ID.
                code_name:
                  type: string
                  description: 'Destination code name. The code name will be unfolded
                    to

                    the list of all respective codes under the hood.'
                effective_from:
                  type: string
                  format: date-time
                  description: Effective date.
                value:
                  type: number
                  format: decimal
                  minimum: -999999999.0
                  maximum: 999999999.0
                  description: 'Rate for a single unit of the event. The unit is defined
                    by

                    `rating_units_id` attribute of the respective service.'
                time_profiles_id:
                  type: integer
                  description: Time profile ID.
                end_date:
                  type:
                  - string
                  - 'null'
                  format: date-time
                  default: null
                  description: 'End date. If not defined, the rate is active till
                    the next

                    effective date of the next rate with the same code.'
                min_volume:
                  type: integer
                  minimum: 1
                  default: 1
                  description: 'Minimum billed volume. To be defined in the units
                    of

                    `rating_params_units_id` attribute of the respective service.'
                pay_interval:
                  type: integer
                  minimum: 1
                  default: 1
                  description: 'Payment interval. Applied when volume of the event
                    is

                    greater than `min_volume`. To be defined in the units of

                    `rating_params_units_id` attribute of the respective service.'
                pay_setup:
                  type: number
                  format: decimal
                  default: 0
                  description: Setup fee. Charged when volume of the event is not
                    zero.
                grace_volume:
                  type: integer
                  minimum: 0
                  default: 0
                  description: 'Volume below which events will not be billed. To be

                    defined in the units of `rating_params_units_id` attribute of
                    the

                    respective service.'
                tag:
                  type: string
                  default: '@'
                  description: Tag.
                num_length_max:
                  type:
                  - integer
                  - 'null'
                  minimum: 1
                  default: null
                  description: 'Maximum dst number length. If destination number does

                    not match the length, the rate will not be applied.'
                num_length_min:
                  type:
                  - integer
                  - 'null'
                  minimum: 1
                  default: null
                  description: 'Minimum dst number length. If destination number does

                    not match the length, the rate will not be applied.'
                notes:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Notes.
                status:
                  type: string
                  enum:
                  - active
                  - stashed
                  default: active
                  description: Status.
                stash_future:
                  type: boolean
                  default: false
                  description: 'If `True`, the rates with the same code for the future

                    will be set in `stashed` status.'
                force_notification:
                  type: boolean
                  default: false
                  description: 'If `True`, the notification will be sent after new

                    rate creation.'
              required:
              - rate_tables_id
              - code_name
              - effective_from
              - value
              - time_profiles_id
              dependentRequired: {}
    get:
      tags:
      - rates.special
      operationId: rates.special.search
      summary: List special rates
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of special rate objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        rates.special.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - code_name
                    - -code_name
                    - currencies_id
                    - -currencies_id
                    - effective_from
                    - -effective_from
                    - effective_till
                    - -effective_till
                    - end_date
                    - -end_date
                    - grace_volume
                    - -grace_volume
                    - id
                    - -id
                    - min_volume
                    - -min_volume
                    - notes
                    - -notes
                    - pay_interval
                    - -pay_interval
                    - pay_setup
                    - -pay_setup
                    - rate_tables_id
                    - -rate_tables_id
                    - src_code
                    - -src_code
                    - status
                    - -status
                    - tag
                    - -tag
                    - time_profiles_id
                    - -time_profiles_id
                    - value
                    - -value
                  default: []
                  description: List of columns to order results by.
                q:
                  type: string
                  description: Quick search (wildcards allowed).
                rate_tables_id:
                  type: integer
                  description: Rate table ID.
                code_name:
                  type: string
                  description: Destination code name.
                dt:
                  type: string
                  format: date-time
                  description: 'Used together with `state` parameter to define timestamp
                    at which

                    the rate state should be checked.'
                state:
                  type: string
                  enum:
                  - current_future
                  - current
                  - future
                  - past
                  - all
                  default: current_future
                  description: Rate status at the timestamp given by `dt` parameter.
                status:
                  type: string
                  enum:
                  - active
                  - stashed
                  description: Status.
                id:
                  type: array
                  items:
                    type: integer
                  description: Rate ID.
                notes:
                  type: string
                  description: Notes.
              required: []
              dependentRequired: {}
  /rates/special/{id}:
    delete:
      tags:
      - rates.special
      operationId: rates.special.delete
      summary: Delete special rate
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Special rate ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        rates.special.delete

        :::


        '
    patch:
      tags:
      - rates.special
      operationId: rates.special.update
      summary: Update special rate
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Special rate ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        rates.special.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                rate_tables_id:
                  type: integer
                  description: Rate table ID.
                effective_from:
                  type: string
                  format: date-time
                  description: Effective date.
                value:
                  type: number
                  format: decimal
                  minimum: -999999999.0
                  maximum: 999999999.0
                  description: 'Rate for a single unit of the event. The unit is defined
                    by

                    `rating_units_id` attribute of the respective service.'
                time_profiles_id:
                  type: integer
                  description: Time profile ID.
                end_date:
                  type:
                  - string
                  - 'null'
                  format: date-time
                  default: null
                  description: 'End date. If not defined, the rate is active till
                    the next

                    effective date of the next rate with the same code.'
                min_volume:
                  type: integer
                  minimum: 1
                  default: 1
                  description: 'Minimum billed volume. To be defined in the units
                    of

                    `rating_params_units_id` attribute of the respective service.'
                pay_interval:
                  type: integer
                  minimum: 1
                  default: 1
                  description: 'Payment interval. Applied when volume of the event
                    is

                    greater than `min_volume`. To be defined in the units of

                    `rating_params_units_id` attribute of the respective service.'
                pay_setup:
                  type: number
                  format: decimal
                  default: 0
                  description: Setup fee. Charged when volume of the event is not
                    zero.
                grace_volume:
                  type: integer
                  minimum: 0
                  default: 0
                  description: 'Volume below which events will not be billed. To be

                    defined in the units of `rating_params_units_id` attribute of
                    the

                    respective service.'
                tag:
                  type: string
                  default: '@'
                  description: Tag.
                num_length_max:
                  type:
                  - integer
                  - 'null'
                  minimum: 1
                  default: null
                  description: 'Maximum dst number length. If destination number does

                    not match the length, the rate will not be applied.'
                num_length_min:
                  type:
                  - integer
                  - 'null'
                  minimum: 1
                  default: null
                  description: 'Minimum dst number length. If destination number does

                    not match the length, the rate will not be applied.'
                notes:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Notes.
                status:
                  type: string
                  enum:
                  - active
                  - stashed
                  default: active
                  description: Status.
              required:
              - rate_tables_id
              - effective_from
              - value
              - time_profiles_id
              dependentRequired: {}
  /rates/tables:
    post:
      tags:
      - rates.tables
      operationId: rates.tables.create
      summary: Create rate table
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Rate table object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        rates.tables.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                companies_id:
                  type: integer
                  description: Partition ID.
                name:
                  type: string
                  minLength: 0
                  maxLength: 128
                  description: Name.
                services_id:
                  type: integer
                  description: Service ID.
                policy:
                  type: string
                  enum:
                  - regular
                  - additive
                  description: Policy.
                currencies_id:
                  type: integer
                  description: Currency ID.
                owner_users_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: Owner user ID.
                tag:
                  type: string
                  default: '@'
                  description: Rating tag.
                parent_rate_tables_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: Parent rate table ID.
                src_code_decks_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: Code deck ID for source codes.
                code_decks_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: Code deck ID for destination codes.
                agreements_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: Rate agreement ID.
                with_taxes:
                  type: boolean
                  default: false
                  description: 'If `True`, the system assumes that rates within rate
                    table

                    include taxes. In this case, the tax value will be calculated
                    from

                    the rate value and the tax rate according to the tax profile of
                    the

                    client.'
                notes:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Notes.
                rates_generators_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: Associated rate generator ID.
                rates_generation_auto:
                  type: boolean
                  default: false
                  description: 'If `True`, the rate generator will be used to

                    generate rates for this rate table.'
                mail_import_template_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Rate import template ID. Required when

                    automatic import is enabled.'
                mail_auto_import:
                  type: boolean
                  default: false
                  description: 'If `True`, automatic rate import from email is

                    enabled. This requires `mail_import_template_id`,

                    `credentials_id` and `remote_settings` to be set.'
                credentials_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Credentials ID. Required when automatic import is

                    enabled.'
                remote_settings:
                  oneOf:
                  - type: object
                    properties:
                      email_sender:
                        type:
                        - string
                        - 'null'
                        maxLength: 256
                        default: null
                      email_subject:
                        type:
                        - string
                        - 'null'
                        maxLength: 256
                        format: regex
                        default: null
                    required: []
                    dependentRequired: {}
                    title: imap
                  - type: object
                    properties: {}
                    required: []
                    dependentRequired: {}
                    title: 'null'
                  - type: object
                    properties:
                      email_sender:
                        type:
                        - string
                        - 'null'
                        maxLength: 256
                        default: null
                      email_subject:
                        type:
                        - string
                        - 'null'
                        maxLength: 256
                        format: regex
                        default: null
                    required: []
                    dependentRequired: {}
                    title: imap_microsoft
                  description: 'Additional settings for matching messages within

                    automatic rate import from email.'
              required:
              - companies_id
              - name
              - services_id
              - policy
              - currencies_id
              dependentRequired: {}
    get:
      tags:
      - rates.tables
      operationId: rates.tables.search
      summary: List rate tables
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of rate table objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        rates.tables.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - companies_name
                    - -companies_name
                    - currencies_name
                    - -currencies_name
                    - id
                    - -id
                    - name
                    - -name
                    - notes
                    - -notes
                  default: []
                  description: List of columns to order results by.
                q:
                  type: string
                  description: Quick search (wildcards allowed).
                id:
                  type: array
                  items:
                    type: integer
                  description: Rate table ID.
                name:
                  type: string
                  description: Name.
                policy:
                  type: array
                  items:
                    type: string
                    enum:
                    - regular
                    - additive
                  default:
                  - regular
                  - additive
                  description: Policy.
                companies_id:
                  type: array
                  items:
                    type: integer
                  description: Partition ID.
                owner_users_id:
                  type: array
                  items:
                    type: integer
                  description: Owner user ID.
                services_id:
                  type: array
                  items:
                    type: integer
                  description: Service ID.
                currencies_id:
                  type: array
                  items:
                    type: integer
                  description: Currency ID.
                code_decks_id:
                  type: array
                  items:
                    type: integer
                  description: Destination code deck ID.
                src_code_decks_id:
                  type: array
                  items:
                    type: integer
                  description: Source code deck ID.
                agreements_id:
                  type: array
                  items:
                    type: integer
                  description: Rate agreement ID.
                tag:
                  type: array
                  items:
                    type: string
                  description: Rate tag, uses "match any" logic.
                rates_generators_id:
                  type: array
                  items:
                    type: integer
                  description: Rate generator ID.
              required: []
              dependentRequired: {}
  /rates/tables/{id}:
    delete:
      tags:
      - rates.tables
      operationId: rates.tables.delete
      summary: Delete rate table
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Rate table ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        rates.tables.delete

        :::


        '
    get:
      tags:
      - rates.tables
      operationId: rates.tables.get
      summary: Get rate table
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Rate table ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Rate table object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        rates.tables.get

        :::


        '
    patch:
      tags:
      - rates.tables
      operationId: rates.tables.update
      summary: Update rate table
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Rate table ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        rates.tables.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 0
                  maxLength: 128
                  description: Name.
                currencies_id:
                  type: integer
                  description: Currency ID.
                tag:
                  type: string
                  default: '@'
                  description: Rating tag.
                parent_rate_tables_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: Parent rate table ID.
                src_code_decks_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: Code deck ID for source codes.
                code_decks_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: Code deck ID for destination codes.
                agreements_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: Rate agreement ID.
                with_taxes:
                  type: boolean
                  default: false
                  description: 'If `True`, the system assumes that rates within rate
                    table

                    include taxes. In this case, the tax value will be calculated
                    from

                    the rate value and the tax rate according to the tax profile of
                    the

                    client.'
                notes:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Notes.
                rates_generators_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: Associated rate generator ID.
                rates_generation_auto:
                  type: boolean
                  default: false
                  description: 'If `True`, the rate generator will be used to

                    generate rates for this rate table.'
                mail_import_template_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Rate import template ID. Required when

                    automatic import is enabled.'
                mail_auto_import:
                  type: boolean
                  default: false
                  description: 'If `True`, automatic rate import from email is

                    enabled. This requires `mail_import_template_id`,

                    `credentials_id` and `remote_settings` to be set.'
                credentials_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Credentials ID. Required when automatic import is

                    enabled.'
                remote_settings:
                  oneOf:
                  - type: object
                    properties:
                      email_sender:
                        type:
                        - string
                        - 'null'
                        maxLength: 256
                        default: null
                      email_subject:
                        type:
                        - string
                        - 'null'
                        maxLength: 256
                        format: regex
                        default: null
                    required: []
                    dependentRequired: {}
                    title: imap
                  - type: object
                    properties: {}
                    required: []
                    dependentRequired: {}
                    title: 'null'
                  - type: object
                    properties:
                      email_sender:
                        type:
                        - string
                        - 'null'
                        maxLength: 256
                        default: null
                      email_subject:
                        type:
                        - string
                        - 'null'
                        maxLength: 256
                        format: regex
                        default: null
                    required: []
                    dependentRequired: {}
                    title: imap_microsoft
                  description: 'Additional settings for matching messages within

                    automatic rate import from email.'
                export_templates_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: Rate export template ID.
                import_templates_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: Rate import template ID.
              required:
              - name
              - currencies_id
              dependentRequired: {}
  /rates/tables/{id}/notify:
    post:
      tags:
      - rates.tables
      operationId: rates.tables.notify
      summary: Send rate notifications
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Rate table ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: None on success. Error is raised otherwise.
          content:
            application/json:
              schema:
                type: 'null'
      description: ':::note[JSON-RPC]

        rates.tables.notify

        :::


        The method is used to send rate notifications to the clients using given

        rate table.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                delayed:
                  type: boolean
                  default: false
                  description: 'If given, the notifications send out will be delayed
                    for

                    period configured in system settings. This period is used in order

                    to avoid sending notifications too frequently when changes to
                    the

                    rate table are still in progress.'
              required: []
              dependentRequired: {}
  /reports/active_sessions:
    post:
      tags:
      - reports.active_sessions
      operationId: reports.active_sessions.query
      summary: Query report
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of report rows.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        reports.active_sessions.query

        :::


        The method generates active sessions report and returns the data according

        to the `return_fields` argument. Please pay attention that quantity of

        fields affect time required to generate the report.


        :::note

        Fields specified in the `order` argument, should be present in the

        `return_fields`.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                return_fields:
                  type: array
                  items:
                    type: string
                    enum:
                    - session_id
                    - session_setup_time
                    - session_start_time
                    - equipment_id
                    - equipment_name
                    - orig_leg_id
                    - orig_src_party_id
                    - orig_dst_party_id
                    - orig_companies_id
                    - orig_owner_users_id
                    - orig_clients_id
                    - orig_clients_name
                    - orig_accounts_id
                    - orig_accounts_name
                    - orig_accounts_ident
                    - orig_rates_code
                    - orig_rates_code_name
                    - term_leg_id
                    - term_src_party_id
                    - term_dst_party_id
                    - term_companies_id
                    - term_owner_users_id
                    - term_clients_id
                    - term_clients_name
                    - term_accounts_id
                    - term_accounts_name
                    - term_accounts_ident
                    - term_rates_code
                    - term_rates_code_name
                    - quantity
                    - duration
                  description: "List of fields to include in the response. Fields\
                    \ can be:\n* Aggregated fields (e.g., total quantity, total duration)\
                    \ -\n    provide summarized values.\n* Singular fields (e.g.,\
                    \ client ID, equipment ID) - define\n    how the data is grouped."
                filters:
                  type: object
                  properties:
                    orig_companies_id:
                      type: array
                      items:
                        type: integer
                      description: 'Origination: partition ID(s) of the client.'
                    orig_owner_users_id:
                      type: array
                      items:
                        type: integer
                      description: 'Origination: owner user ID(s) of the client.'
                    orig_clients_id:
                      type: array
                      items:
                        type: integer
                      description: 'Origination: client ID(s).'
                    orig_accounts_id:
                      type: array
                      items:
                        type: integer
                      description: 'Origination: account ID(s).'
                    orig_rates_code:
                      type: array
                      items:
                        type: string
                      description: 'Origination: rate code(s).'
                    orig_rates_code_name:
                      type: array
                      items:
                        type: string
                      description: 'Origination: rate code name(s).'
                    term_companies_id:
                      type: array
                      items:
                        type: integer
                      description: 'Termination: partition ID(s) of the client.'
                    term_owner_users_id:
                      type: array
                      items:
                        type: integer
                      description: 'Termination: owner user ID(s) of the client.'
                    term_clients_id:
                      type: array
                      items:
                        type: integer
                      description: 'Termination: client ID(s).'
                    term_accounts_id:
                      type: array
                      items:
                        type: integer
                      description: 'Termination: account ID(s).'
                    term_rates_code:
                      type: array
                      items:
                        type: string
                      description: 'Termination: rate code(s).'
                    term_rates_code_name:
                      type: array
                      items:
                        type: string
                      description: 'Termination: rate code name(s).'
                    quantity:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: integer
                      example:
                      - 1
                      - 9
                      description: Total quantity, given as range.
                    duration:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: integer
                      example:
                      - 1
                      - 9
                      description: Total volume (duration), given as range.
                  required: []
                  dependentRequired: {}
                  default: {}
                  description: Filters for report.
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - duration
                    - -duration
                    - equipment_id
                    - -equipment_id
                    - equipment_name
                    - -equipment_name
                    - orig_accounts_id
                    - -orig_accounts_id
                    - orig_accounts_ident
                    - -orig_accounts_ident
                    - orig_accounts_name
                    - -orig_accounts_name
                    - orig_clients_id
                    - -orig_clients_id
                    - orig_clients_name
                    - -orig_clients_name
                    - orig_companies_id
                    - -orig_companies_id
                    - orig_dst_party_id
                    - -orig_dst_party_id
                    - orig_leg_id
                    - -orig_leg_id
                    - orig_owner_users_id
                    - -orig_owner_users_id
                    - orig_rates_code
                    - -orig_rates_code
                    - orig_rates_code_name
                    - -orig_rates_code_name
                    - orig_src_party_id
                    - -orig_src_party_id
                    - quantity
                    - -quantity
                    - session_id
                    - -session_id
                    - session_setup_time
                    - -session_setup_time
                    - session_start_time
                    - -session_start_time
                    - term_accounts_id
                    - -term_accounts_id
                    - term_accounts_ident
                    - -term_accounts_ident
                    - term_accounts_name
                    - -term_accounts_name
                    - term_clients_id
                    - -term_clients_id
                    - term_clients_name
                    - -term_clients_name
                    - term_companies_id
                    - -term_companies_id
                    - term_dst_party_id
                    - -term_dst_party_id
                    - term_leg_id
                    - -term_leg_id
                    - term_owner_users_id
                    - -term_owner_users_id
                    - term_rates_code
                    - -term_rates_code
                    - term_rates_code_name
                    - -term_rates_code_name
                    - term_src_party_id
                    - -term_src_party_id
                  default: []
                  description: 'List of fields to order results by. Any fields used
                    in this

                    list should be present in `return_fields`.'
                limit:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Number of rows to return. It is typically used with
                    `order`

                    argument to get top X rows ranked by some attribute.'
                grouping_mode:
                  type:
                  - string
                  - 'null'
                  enum:
                  - rollup
                  default: null
                  description: "Grouping mode for aggregation:\n* `rollup` - the report\
                    \ will include intermediate subtotals and\n    full totals aside\
                    \ from regular records.\n* `null` - the report will include only\
                    \ regular records."
                code_decks_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Code deck ID to use for providing code name and country

                    for destination codes. If not set, the code decks of the rate

                    tables used during billing will be used.'
                timezone:
                  type:
                  - string
                  - 'null'
                  format: timezone
                  default: null
                  description: 'Timezone to use for date-based aggregation. If not
                    set,

                    `UTC` will be used.'
              required:
              - return_fields
              dependentRequired: {}
  /reports/origterm:
    post:
      tags:
      - reports.origterm
      operationId: reports.origterm.query
      summary: Query report
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of report rows.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ":::note[JSON-RPC]\nreports.origterm.query\n:::\n\nThe method generates\
        \ orig-term report and returns the data according to\nthe `return_fields`\
        \ argument. Please pay attention that quantity of\nfields affect time required\
        \ to generate the report.\n\nThere is a set of rules that apply to the list\
        \ of queried fields:\n    1. Fields specified in the `order` argument, should\
        \ be present in\n        the `return_fields`.\n    2. If any of the volume-dependent\
        \ fields is present in the\n        `return_fields`, then `services_id` should\
        \ be also present\n        in the `return_fields`.\n\n:::info Volume-dependent\
        \ fields\n    * `volume_total`\n    * `orig_volume_rated`\n    * `term_volume_rated`\n\
        \    * `orig_rates_value_avg`\n    * `term_rates_value_avg`\n    * `acd_std`\n\
        \    * `acd_cur`\n:::"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                filters:
                  type: object
                  properties:
                    date:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: string
                        format: date-time
                      example:
                      - '2025-06-10T10:00:00.000Z'
                      - '2025-07-02T16:00:00.000Z'
                      description: Date (timestamp) range.
                    services_id:
                      type: array
                      items:
                        type: integer
                      description: Service ID(s).
                    orig_clients_matched:
                      type: boolean
                      description: 'Origination: if `True`, uses only events where
                        client has been successfully identified. If `False`, uses
                        only events where client has not been identified. If not given,
                        the filtering is not applied.'
                    orig_rates_matched:
                      type: string
                      enum:
                      - matched
                      - deleted
                      - mismatched
                      description: 'Origination: defines the match status of the rate
                        used for billing. If not given, the filtering is not applied.'
                    orig_companies_id:
                      type: array
                      items:
                        type: integer
                      description: 'Origination: partition ID(s) of the client.'
                    orig_legal_entities_id:
                      type: array
                      items:
                        type: integer
                      description: 'Origination: legal entity ID(s) of the client.'
                    orig_owner_users_id:
                      type: array
                      items:
                        type: integer
                      description: 'Origination: owner user ID(s) of the client.'
                    orig_clients_id:
                      type: array
                      items:
                        type: integer
                      description: 'Origination: client ID(s).'
                    orig_clients_type:
                      type: array
                      items:
                        type: integer
                        enum:
                        - 0
                        - 3
                        - 10
                      description: 'Origination: client type(s).'
                    orig_accounts_id:
                      type: array
                      items:
                        type: integer
                      description: 'Origination: account ID(s).'
                    orig_rates_code:
                      type: array
                      items:
                        type: string
                      description: 'Origination: rate code(s).'
                    orig_rates_code_name:
                      type: array
                      items:
                        type: string
                      description: 'Origination: rate code name(s).'
                    orig_rates_code_country:
                      type: array
                      items:
                        type: string
                      description: 'Origination: rate code country(s).'
                    orig_rates_src_code:
                      type: array
                      items:
                        type: string
                      description: 'Origination: rate source code(s).'
                    orig_rates_src_code_name:
                      type: array
                      items:
                        type: string
                      description: 'Origination: rate source code name(s).'
                    orig_rates_src_code_country:
                      type: array
                      items:
                        type: string
                      description: 'Origination: rate source code country(s).'
                    orig_rates_time_profiles_id:
                      type: array
                      items:
                        type: integer
                      description: 'Origination: rate time profile ID(s).'
                    orig_clients_tags:
                      type: array
                      items:
                        type: string
                      description: 'Origination: client tags(s).'
                    orig_accounts_tags:
                      type: array
                      items:
                        type: string
                      description: 'Origination: account tags(s).'
                    term_clients_matched:
                      type: boolean
                      description: 'Termination: if `True`, uses only events where
                        client has been successfully identified. If `False`, uses
                        only events where client has not been identified. If not given,
                        the filtering is not applied.'
                    term_rates_matched:
                      type: string
                      enum:
                      - matched
                      - deleted
                      - mismatched
                      description: 'Termination: defines the match status of the rate
                        used for billing. If not given, the filtering is not applied.'
                    term_companies_id:
                      type: array
                      items:
                        type: integer
                      description: 'Termination: partition ID(s) of the client.'
                    term_legal_entities_id:
                      type: array
                      items:
                        type: integer
                      description: 'Termination: legal entity ID(s) of the client.'
                    term_owner_users_id:
                      type: array
                      items:
                        type: integer
                      description: 'Termination: owner user ID(s) of the client.'
                    term_clients_id:
                      type: array
                      items:
                        type: integer
                      description: 'Termination: client ID(s).'
                    term_clients_type:
                      type: array
                      items:
                        type: integer
                        enum:
                        - 0
                        - 3
                        - 10
                      description: 'Termination: client type(s).'
                    term_accounts_id:
                      type: array
                      items:
                        type: integer
                      description: 'Termination: account ID(s).'
                    term_rates_code:
                      type: array
                      items:
                        type: string
                      description: 'Termination: rate code(s).'
                    term_rates_code_name:
                      type: array
                      items:
                        type: string
                      description: 'Termination: rate code name(s).'
                    term_rates_code_country:
                      type: array
                      items:
                        type: string
                      description: 'Termination: rate code country(s).'
                    term_rates_src_code:
                      type: array
                      items:
                        type: string
                      description: 'Termination: rate source code(s).'
                    term_rates_src_code_name:
                      type: array
                      items:
                        type: string
                      description: 'Termination: rate source code name(s).'
                    term_rates_src_code_country:
                      type: array
                      items:
                        type: string
                      description: 'Termination: rate source code country(s).'
                    term_rates_time_profiles_id:
                      type: array
                      items:
                        type: integer
                      description: 'Termination: rate time profile ID(s).'
                    term_clients_tags:
                      type: array
                      items:
                        type: string
                      description: 'Termination: client tags(s).'
                    term_accounts_tags:
                      type: array
                      items:
                        type: string
                      description: 'Termination: account tags(s).'
                    quality_asr_cur:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: ASR (current), given as a range.
                    quality_asr_std:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: ASR (standard), given as a range.
                    quality_acd_cur:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: ACD (current), given as a range.
                    quality_acd_std:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: ACD (standard), given as a range.
                    quantity_total:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: integer
                      example:
                      - 1
                      - 9
                      description: Total events quantity, given as a range.
                    quantity_notzero:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: integer
                      example:
                      - 1
                      - 9
                      description: Not zero events quantity, given as a range.
                    quantity_success:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: integer
                      example:
                      - 1
                      - 9
                      description: Successful events quantity, given as a range.
                    quantity_busy:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: integer
                      example:
                      - 1
                      - 9
                      description: Busy events quantity, given as a range.
                    quantity_nochannel:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: integer
                      example:
                      - 1
                      - 9
                      description: No channel events quantity, given as a range.
                    quantity_error:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: integer
                      example:
                      - 1
                      - 9
                      description: Error events quantity, given as a range.
                    volume_total:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: Total volume, given as a range.
                    profit:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: Total profit, given as a range.
                    profit_rel:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: Relative profit, given as a range.
                    margin:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: Profit margin, given as a range.
                    orig_volume_rated:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: 'Origination: rated volume (out of subscriptions),
                        given as a range.'
                    orig_cost_rated:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: 'Origination: rated cost (out of subscriptions),
                        given as a range.'
                    orig_rates_value_avg:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: 'Origination: average rate value, given as a range.'
                    term_volume_rated:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: 'Termination: rated volume (out of subscriptions),
                        given as a range.'
                    term_cost_rated:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: 'Termination: rated cost (out of subscriptions),
                        given as a range.'
                    term_rates_value_avg:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: 'Termination: average rate value, given as a range.'
                  required:
                  - date
                  dependentRequired: {}
                  description: Filters for report.
                return_fields:
                  type: array
                  items:
                    type: string
                    enum:
                    - date_year
                    - date_month
                    - date_day
                    - date_hour
                    - services_id
                    - services_name
                    - services_units_id
                    - services_precision_volume
                    - currencies_id
                    - currencies_precision_details
                    - currencies_precision_rates
                    - orig_companies_id
                    - orig_companies_name
                    - orig_legal_entities_id
                    - orig_legal_entities_name
                    - orig_owner_users_id
                    - orig_owner_users_fullname
                    - orig_clients_id
                    - orig_clients_name
                    - orig_clients_type
                    - orig_clients_tags
                    - orig_clients_matched
                    - orig_accounts_id
                    - orig_accounts_name
                    - orig_accounts_tags
                    - orig_rates_id
                    - orig_rates_code
                    - orig_rates_code_name
                    - orig_rates_code_country
                    - orig_rates_src_code
                    - orig_rates_src_code_name
                    - orig_rates_src_code_country
                    - orig_rates_value
                    - orig_rates_time_profiles_id
                    - orig_rates_time_profiles_name
                    - orig_rates_matched
                    - term_companies_id
                    - term_companies_name
                    - term_legal_entities_id
                    - term_legal_entities_name
                    - term_owner_users_id
                    - term_owner_users_fullname
                    - term_clients_id
                    - term_clients_name
                    - term_clients_type
                    - term_clients_tags
                    - term_clients_matched
                    - term_accounts_id
                    - term_accounts_name
                    - term_accounts_tags
                    - term_rates_id
                    - term_rates_code
                    - term_rates_code_name
                    - term_rates_code_country
                    - term_rates_src_code
                    - term_rates_src_code_name
                    - term_rates_src_code_country
                    - term_rates_value
                    - term_rates_time_profiles_id
                    - term_rates_time_profiles_name
                    - term_rates_matched
                    - date_min
                    - date_max
                    - quantity_total
                    - quantity_notzero
                    - quantity_success
                    - quantity_busy
                    - quantity_nochannel
                    - quantity_error
                    - quality_asr_cur
                    - quality_asr_std
                    - quality_acd_cur
                    - quality_acd_std
                    - volume_total
                    - profit
                    - profit_rel
                    - margin
                    - orig_volume_rated
                    - orig_cost_rated
                    - orig_rates_value_avg
                    - term_volume_rated
                    - term_cost_rated
                    - term_rates_value_avg
                  description: "List of fields to include in the response. Fields\
                    \ can be:\n* Aggregated fields (e.g., total quantity, total duration)\
                    \ - provide\n    summarized values.\n* Singular fields (e.g.,\
                    \ client ID, equipment ID) - define\n    how the data is grouped."
                currencies_id:
                  type: integer
                  description: Currency ID to convert all returned monetary values
                    to.
                comparison_mode:
                  type:
                  - string
                  - 'null'
                  enum:
                  - previous-period
                  - previous-day
                  - previous-week
                  - previous-month
                  - previous-year
                  default: null
                  description: Comparison mode for the historical data.
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - currencies_id
                    - -currencies_id
                    - currencies_precision_details
                    - -currencies_precision_details
                    - currencies_precision_rates
                    - -currencies_precision_rates
                    - date_day
                    - -date_day
                    - date_hour
                    - -date_hour
                    - date_max
                    - -date_max
                    - date_min
                    - -date_min
                    - date_month
                    - -date_month
                    - date_year
                    - -date_year
                    - margin
                    - -margin
                    - orig_accounts_id
                    - -orig_accounts_id
                    - orig_accounts_name
                    - -orig_accounts_name
                    - orig_accounts_tags
                    - -orig_accounts_tags
                    - orig_clients_id
                    - -orig_clients_id
                    - orig_clients_matched
                    - -orig_clients_matched
                    - orig_clients_name
                    - -orig_clients_name
                    - orig_clients_tags
                    - -orig_clients_tags
                    - orig_clients_type
                    - -orig_clients_type
                    - orig_companies_id
                    - -orig_companies_id
                    - orig_companies_name
                    - -orig_companies_name
                    - orig_cost_rated
                    - -orig_cost_rated
                    - orig_legal_entities_id
                    - -orig_legal_entities_id
                    - orig_legal_entities_name
                    - -orig_legal_entities_name
                    - orig_owner_users_fullname
                    - -orig_owner_users_fullname
                    - orig_owner_users_id
                    - -orig_owner_users_id
                    - orig_rates_code
                    - -orig_rates_code
                    - orig_rates_code_country
                    - -orig_rates_code_country
                    - orig_rates_code_name
                    - -orig_rates_code_name
                    - orig_rates_id
                    - -orig_rates_id
                    - orig_rates_matched
                    - -orig_rates_matched
                    - orig_rates_src_code
                    - -orig_rates_src_code
                    - orig_rates_src_code_country
                    - -orig_rates_src_code_country
                    - orig_rates_src_code_name
                    - -orig_rates_src_code_name
                    - orig_rates_time_profiles_id
                    - -orig_rates_time_profiles_id
                    - orig_rates_time_profiles_name
                    - -orig_rates_time_profiles_name
                    - orig_rates_value
                    - -orig_rates_value
                    - orig_rates_value_avg
                    - -orig_rates_value_avg
                    - orig_volume_rated
                    - -orig_volume_rated
                    - profit
                    - -profit
                    - profit_rel
                    - -profit_rel
                    - quality_acd_cur
                    - -quality_acd_cur
                    - quality_acd_std
                    - -quality_acd_std
                    - quality_asr_cur
                    - -quality_asr_cur
                    - quality_asr_std
                    - -quality_asr_std
                    - quantity_busy
                    - -quantity_busy
                    - quantity_error
                    - -quantity_error
                    - quantity_nochannel
                    - -quantity_nochannel
                    - quantity_notzero
                    - -quantity_notzero
                    - quantity_success
                    - -quantity_success
                    - quantity_total
                    - -quantity_total
                    - services_id
                    - -services_id
                    - services_name
                    - -services_name
                    - services_precision_volume
                    - -services_precision_volume
                    - services_units_id
                    - -services_units_id
                    - term_accounts_id
                    - -term_accounts_id
                    - term_accounts_name
                    - -term_accounts_name
                    - term_accounts_tags
                    - -term_accounts_tags
                    - term_clients_id
                    - -term_clients_id
                    - term_clients_matched
                    - -term_clients_matched
                    - term_clients_name
                    - -term_clients_name
                    - term_clients_tags
                    - -term_clients_tags
                    - term_clients_type
                    - -term_clients_type
                    - term_companies_id
                    - -term_companies_id
                    - term_companies_name
                    - -term_companies_name
                    - term_cost_rated
                    - -term_cost_rated
                    - term_legal_entities_id
                    - -term_legal_entities_id
                    - term_legal_entities_name
                    - -term_legal_entities_name
                    - term_owner_users_fullname
                    - -term_owner_users_fullname
                    - term_owner_users_id
                    - -term_owner_users_id
                    - term_rates_code
                    - -term_rates_code
                    - term_rates_code_country
                    - -term_rates_code_country
                    - term_rates_code_name
                    - -term_rates_code_name
                    - term_rates_id
                    - -term_rates_id
                    - term_rates_matched
                    - -term_rates_matched
                    - term_rates_src_code
                    - -term_rates_src_code
                    - term_rates_src_code_country
                    - -term_rates_src_code_country
                    - term_rates_src_code_name
                    - -term_rates_src_code_name
                    - term_rates_time_profiles_id
                    - -term_rates_time_profiles_id
                    - term_rates_time_profiles_name
                    - -term_rates_time_profiles_name
                    - term_rates_value
                    - -term_rates_value
                    - term_rates_value_avg
                    - -term_rates_value_avg
                    - term_volume_rated
                    - -term_volume_rated
                    - volume_total
                    - -volume_total
                  default: []
                  description: 'List of fields to order results by. Any fields used
                    in this

                    list should be present in `return_fields`.'
                grouping_mode:
                  type:
                  - string
                  - 'null'
                  enum:
                  - rollup
                  - totals
                  default: null
                  description: "Grouping mode for aggregation:\n* `rollup` - the report\
                    \ will include intermediate subtotals and\n    full totals aside\
                    \ from regular records.\n* `totals` - the report will include\
                    \ regular records and top-level\n    totals.\n* `null` - the report\
                    \ will include only regular records."
                code_decks_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Code deck ID to use for providing code name and country

                    for destination codes. If not set, the code decks of the rate

                    tables used during billing will be used.'
                src_code_decks_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Code deck ID to use for providing code name and

                    country for source codes. If not set, the code decks of the rate

                    tables used during billing will be used.'
                timezone:
                  type:
                  - string
                  - 'null'
                  format: timezone
                  default: null
                  description: 'Timezone to use for date-based aggregation. If not
                    set,

                    `UTC` will be used.'
              required:
              - filters
              - return_fields
              - currencies_id
              dependentRequired: {}
  /reports/queries:
    post:
      tags:
      - reports.queries
      operationId: reports.queries.create
      summary: Create stored query
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Stored query object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        reports.queries.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Name.
                reports_module:
                  type: string
                  enum:
                  - active_sessions
                  - balance
                  - customer_dynamics
                  - invoicing
                  - origterm
                  - profit
                  - rates_analysis2
                  - routing_analysis
                  - summary
                  - xdrs_list
                  description: Report module.
                query:
                  type: object
                  description: Query details according to the report module.
                type:
                  type: string
                  enum:
                  - regular
                  - one-time
                  default: regular
                  description: "Query type:\n* `regular` - regular stored query, that\
                    \ can be used within UI,\n    with possibility of using periodic\
                    \ monitoring and to email\n    delivery.\n* `one-time` - one-time\
                    \ query, that will be executed once and\n    then deleted. Used\
                    \ to execute long-running queries and\n    deliver results to\
                    \ email."
                visibility:
                  type: string
                  enum:
                  - private
                  - public
                  default: private
                  description: Visibility.
              required:
              - name
              - reports_module
              - query
              dependentRequired: {}
    get:
      tags:
      - reports.queries
      operationId: reports.queries.search
      summary: List stored queries
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of stored query objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        reports.queries.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - id
                    - -id
                    - name
                    - -name
                    - reports_module
                    - -reports_module
                  default: []
                  description: List of columns to order results by.
                q:
                  type: string
                  description: Quick search (wildcards allowed).
                id:
                  type: array
                  items:
                    type: integer
                  description: Stored query ID.
                type:
                  type: string
                  enum:
                  - regular
                  - one-time
                  description: Type.
                reports_module:
                  type: array
                  items:
                    type: string
                    enum:
                    - active_sessions
                    - balance
                    - customer_dynamics
                    - invoicing
                    - origterm
                    - profit
                    - rates_analysis2
                    - routing_analysis
                    - summary
                    - xdrs_list
                  description: Report module name.
                include_subentities:
                  type: array
                  items:
                    type: string
                    enum:
                    - toemail
                    - monitoring
                  description: 'Which sub-configurations should be included into

                    the result.'
                toemail:
                  type: object
                  properties:
                    notify_emails:
                      type: array
                      items:
                        type: string
                      description: Recipient email addresses. Only extra emails are
                        considered (not system user emails).
                  required: []
                  dependentRequired: {}
                  description: Additional filter for "to email" sub-configuration.
              required: []
              dependentRequired: {}
  /reports/queries/{id}:
    delete:
      tags:
      - reports.queries
      operationId: reports.queries.delete
      summary: Delete stored query
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Stored query ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        reports.queries.delete

        :::


        Stored query can be deleted only by its owner.'
    get:
      tags:
      - reports.queries
      operationId: reports.queries.get
      summary: Get stored query
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Stored query ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Stored query object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        reports.queries.get

        :::


        '
    patch:
      tags:
      - reports.queries
      operationId: reports.queries.update
      summary: Update stored query
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Stored query ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        reports.queries.update

        :::


        Stored query can be updated only by its owner.


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Name.
                query:
                  type: object
                  description: Query details according to the report module.
                visibility:
                  type: string
                  enum:
                  - private
                  - public
                  default: private
                  description: Visibility.
              required:
              - name
              - query
              dependentRequired: {}
  /reports/queries/monitoring/{reports_queries_id}:
    get:
      tags:
      - reports.queries.monitoring
      operationId: reports.queries.monitoring.get
      summary: Get monitoring rule
      parameters:
      - in: path
        name: reports_queries_id
        schema:
          type: integer
        required: true
        description: Stored query ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Monitoring rule object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        reports.queries.monitoring.get

        :::


        '
    patch:
      tags:
      - reports.queries.monitoring
      operationId: reports.queries.monitoring.update
      summary: Update monitoring rule
      parameters:
      - in: path
        name: reports_queries_id
        schema:
          type: integer
        required: true
        description: Stored query ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Monitoring rule details as stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        reports.queries.monitoring.update

        :::


        :::info

        For the report query with an existing monitoring rule - all parameters

        except `reports_queries_id` are optional, only provided parameters will

        be updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                schedule:
                  type: object
                  properties:
                    type:
                      type: string
                      enum:
                      - fixed
                      - periodic
                      description: Schedule type.
                    fixed_timetable:
                      type: array
                      items:
                        type: object
                        properties:
                          time:
                            type: string
                            format: time
                            description: Time of the day.
                          dows:
                            type: array
                            items:
                              type: integer
                              minimum: 1
                              maximum: 7
                            description: Days of the week.
                            default:
                            - 1
                            - 2
                            - 3
                            - 4
                            - 5
                            - 6
                            - 7
                        required:
                        - time
                        dependentRequired: {}
                      description: 'Fixed schedule: execution timetable. Required
                        for `fixed` schedule type.'
                      default: []
                    fixed_timezone:
                      type:
                      - string
                      - 'null'
                      format: timezone
                      description: 'Fixed schedule: timezone of execution. Required
                        for `fixed` schedule type.'
                      default: null
                    periodic_period:
                      type:
                      - string
                      - 'null'
                      format: duration
                      description: 'Periodic schedule: period of execution in ISO8601
                        format. Required for `periodic` schedule type.'
                      default: null
                    next_run:
                      type:
                      - string
                      - 'null'
                      format: date-time
                      description: Next scheduled execution timestamp.
                      default: null
                  required:
                  - type
                  dependentRequired: {}
                  description: Execution schedule.
                status:
                  type: string
                  enum:
                  - enabled
                  - disabled
                  default: enabled
                  description: Status.
                expiry_mode:
                  type: string
                  enum:
                  - no_expiry
                  - interval
                  - calendar_period
                  - payment_terms
                  default: no_expiry
                  description: "Traffic rule action: expiry mode:\n* `no_expiry` -\
                    \ traffic rule created without expiry date;\n* `calendar_period`\
                    \ - traffic rule created with expiry date calculated\n    as the\
                    \ end of the current calendar period given in\n    `expiry_calendar_period`;\n\
                    * `payment_terms` - traffic rule created with expiry date\n  \
                    \  calculated as the end of the current billing period\n    for\
                    \ the client according to the payment terms\n    (can be used\
                    \ for rules that match client or account);\n* `interval` - traffic\
                    \ rule created with expiry date calculated\n    as current time\
                    \ plus the interval given in `expiry_interval`."
                expiry_interval:
                  type:
                  - string
                  - 'null'
                  format: duration
                  default: null
                  description: 'Traffic rule action: expiry interval for `interval`

                    expiry mode.'
                expiry_calendar_period:
                  type:
                  - string
                  - 'null'
                  enum:
                  - hour
                  - day
                  - month
                  - year
                  default: null
                  description: 'Traffic rule action: expiry calendar period

                    for `calendar_period` expiry mode.'
                action_match:
                  type: array
                  items:
                    type: string
                  default: []
                  description: 'Traffic rule action: list of the report columns that

                    should be used as traffic rule filters.'
                action_block:
                  type: boolean
                  default: false
                  description: 'Traffic rule action: if `True`, traffic rule will

                    be created with "Deny" action to block traffic that matches the

                    the query filters.'
                action_add_tags:
                  type: array
                  items:
                    type: string
                  default: []
                  description: 'Traffic rule action: list of tags that should be

                    added to events that match the traffic rule filters.'
                notify_users_ids:
                  type: array
                  items:
                    type:
                    - integer
                    - 'null'
                    default: null
                  default: []
                  description: 'User ID(s) to notify. Email defined for the user

                    will be used as a recipient.'
                notify_emails:
                  type: array
                  items:
                    type: string
                    format: email
                  default: []
                  description: 'Email addresses to notify. Used for delivery to the

                    recipients, who do not have system user account.'
                notify_clients_owner:
                  type: boolean
                  default: false
                  description: 'If `True`, user defined as client owner will be

                    notified in case of client matching the monitoring rule.'
                notify_clients_emails_types:
                  type: array
                  items:
                    type: string
                    enum:
                    - main
                    - noc
                    - billing
                    - rates
                  default: []
                  description: 'If defined, corresponding types of client

                    emails will be notified in case of client matching the monitoring

                    rule.'
                notify_clients_origin:
                  type:
                  - string
                  - 'null'
                  enum:
                  - orig
                  - term
                  default: null
                  description: 'If defined, corresponding originating client

                    will be notified. Used for "Orig-Term" and "Active Sessions"

                    reports, where matching is done by both origins.'
              required:
              - schedule
              dependentRequired:
                action_add_tags:
                - action_match
  /reports/queries/monitoring:
    get:
      tags:
      - reports.queries.monitoring
      operationId: reports.queries.monitoring.search
      summary: List monitoring rules
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of monitoring rule objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        reports.queries.monitoring.search

        :::


        Monitoring Rules of private Queries are visible only to their owners.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - reports_queries_id
                    - -reports_queries_id
                  default: []
                  description: List of columns to order results by.
                reports_queries_id:
                  type: array
                  items:
                    type: integer
                  description: Stored query ID.
              required: []
              dependentRequired: {}
  /reports/queries/toemail/{reports_queries_id}:
    get:
      tags:
      - reports.queries.toemail
      operationId: reports.queries.toemail.get
      summary: Get to email rule
      parameters:
      - in: path
        name: reports_queries_id
        schema:
          type: integer
        required: true
        description: Stored query ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Email rule object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        reports.queries.toemail.get

        :::


        '
    patch:
      tags:
      - reports.queries.toemail
      operationId: reports.queries.toemail.update
      summary: Update to email rule
      parameters:
      - in: path
        name: reports_queries_id
        schema:
          type: integer
        required: true
        description: Stored query ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Email rule details as stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        reports.queries.toemail.update

        :::


        :::info

        For the report query with an existing to email rule - all parameters

        except `reports_queries_id` are optional, only provided parameters will

        be updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                output_type:
                  type: string
                  enum:
                  - xlsx
                  - csv
                  description: Output file type.
                schedule:
                  type: object
                  properties:
                    type:
                      type: string
                      enum:
                      - fixed
                      - periodic
                      - one-time
                      description: Schedule type.
                    fixed_timetable:
                      type: array
                      items:
                        type: object
                        properties:
                          time:
                            type: string
                            format: time
                            description: Time of the day.
                          dows:
                            type: array
                            items:
                              type: integer
                              minimum: 1
                              maximum: 7
                            description: Days of the week.
                            default:
                            - 1
                            - 2
                            - 3
                            - 4
                            - 5
                            - 6
                            - 7
                        required:
                        - time
                        dependentRequired: {}
                      description: 'Fixed schedule: execution timetable. Required
                        for `fixed` schedule type.'
                      default: []
                    fixed_timezone:
                      type:
                      - string
                      - 'null'
                      format: timezone
                      description: 'Fixed schedule: timezone of execution. Required
                        for `fixed` schedule type.'
                      default: null
                    periodic_period:
                      type:
                      - string
                      - 'null'
                      format: duration
                      description: 'Periodic schedule: period of execution in ISO8601
                        format. Required for `periodic` schedule type.'
                      default: null
                    next_run:
                      type:
                      - string
                      - 'null'
                      format: date-time
                      description: Next scheduled execution timestamp.
                      default: null
                  required:
                  - type
                  dependentRequired: {}
                  description: Execution schedule.
                status:
                  type: string
                  enum:
                  - enabled
                  - disabled
                  default: enabled
                  description: Status.
                notify_users_ids:
                  type: array
                  items:
                    type:
                    - integer
                    - 'null'
                    default: null
                  default: []
                  description: 'User ID(s) to notify. Email defined for the user

                    will be used as a recipient.'
                notify_emails:
                  type: array
                  items:
                    type: string
                    format: email
                  default: []
                  description: 'Email addresses to notify. Used for delivery to the

                    recipients, who do not have system user account.'
              required:
              - output_type
              - schedule
              dependentRequired: {}
  /reports/queries/toemail:
    get:
      tags:
      - reports.queries.toemail
      operationId: reports.queries.toemail.search
      summary: List to email rules
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of email rule objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        reports.queries.toemail.search

        :::


        To Email Rules of private Queries are visible only to their owners.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - reports_queries_id
                    - -reports_queries_id
                  default: []
                  description: List of columns to order results by.
                reports_queries_id:
                  type: array
                  items:
                    type: integer
                  description: Stored query ID.
                notify_emails:
                  type: array
                  items:
                    type: string
                  description: 'Recipient email addresses. Only extra emails are

                    considered (not system user emails).'
              required: []
              dependentRequired: {}
  /reports/summary:
    post:
      tags:
      - reports.summary
      operationId: reports.summary.query
      summary: Query report
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of report rows.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ":::note[JSON-RPC]\nreports.summary.query\n:::\n\nThe method generates\
        \ summary report and returns the data according to\nthe `return_fields` argument.\
        \ Please pay attention that quantity of\nfields affect time required to generate\
        \ the report.\n\nThere is a set of rules that apply to the list of queried\
        \ fields:\n    1. Fields specified in the `order` argument, should be present\
        \ in\n        the `return_fields`.\n    2. Field `record_origin` should be\
        \ present in `return_fields`\n        or given within filters as a single-value\
        \ filter.\n    3. If any of the currency-dependent fields is present in the\n\
        \        `return_fields`, then `currencies_id` should also be present\n  \
        \      in the `return_fields` or given as method argument.\n    4. If any\
        \ of the volume-dependent fields is present in the\n        `return_fields`,\
        \ then `services_id` should be also present\n        in the `return_fields`.\n\
        \n:::info Currency-dependent fields\n    * `rates_value`\n    * `rates_pay_setup`\n\
        \    * `rates_value_additive`\n    * `rates_value_avg`\n    * `cost_rated`\n\
        \    * `cost_package`\n    * `cost_rated_additive`\n    * `cost_taxes`\n \
        \   * `cost_rated_pay_setup`\n:::\n\n:::info Volume-dependent fields\n   \
        \ * `volume_total`\n    * `volume_rated`\n    * `volume_package`\n    * `rates_value_avg`\n\
        \    * `acd_std`\n    * `acd_cur`\n:::"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                filters:
                  type: object
                  properties:
                    date:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: string
                        format: date-time
                      example:
                      - '2025-06-10T10:00:00.000Z'
                      - '2025-07-02T16:00:00.000Z'
                      description: Date (timestamp) range.
                    date_time_profiles_id:
                      type:
                      - integer
                      - 'null'
                      description: Time Profile ID to query events within.
                      default: null
                    record_origin:
                      type: string
                      enum:
                      - orig
                      - term
                      description: Event origin.
                    record_result_code:
                      type: array
                      items:
                        type: integer
                      description: Result code of the equipment, normalized to Q.931
                        codes.
                    clients_matched:
                      type: boolean
                      description: If `True`, uses only events where client has been
                        successfully identified. If `False`, uses only events where
                        client has not been identified.
                    rates_matched:
                      type: string
                      enum:
                      - matched
                      - deleted
                      - mismatched
                      description: Defines the match status of the rate used for billing.
                    services_id:
                      type: array
                      items:
                        type: integer
                      description: Service ID(s).
                    equipment_id:
                      type: array
                      items:
                        type: integer
                      description: Equipment ID(s).
                    equipment_tag:
                      type: array
                      items:
                        type: string
                      description: Equipment tag(s).
                    companies_id:
                      type: array
                      items:
                        type: integer
                      description: Partition ID(s) of the client.
                    legal_entities_id:
                      type: array
                      items:
                        type: integer
                      description: Legal entity ID(s) of the client.
                    owner_users_id:
                      type: array
                      items:
                        type: integer
                      description: Owner user ID(s) of the client.
                    clients_id:
                      type: array
                      items:
                        type: integer
                      description: Client ID(s).
                    clients_id_not:
                      type: array
                      items:
                        type: integer
                      description: Client ID(s) to exclude from result.
                    clients_type:
                      type: array
                      items:
                        type: integer
                        enum:
                        - 0
                        - 3
                        - 10
                      description: Client type(s).
                    clients_tags:
                      type: array
                      items:
                        type: string
                      description: Client tag(s).
                    accounts_id:
                      type: array
                      items:
                        type: integer
                      description: Account ID(s).
                    accounts_tags:
                      type: array
                      items:
                        type: string
                      description: Account tag(s).
                    rates_id:
                      type: array
                      items:
                        type: integer
                      description: Rate ID(s).
                    rates_code:
                      type: array
                      items:
                        type: string
                      description: Rate code(s).
                    rates_code_name:
                      type: array
                      items:
                        type: string
                      description: Rate code name(s).
                    rates_code_country:
                      type: array
                      items:
                        type: string
                      description: Rate code country(s).
                    rates_src_code:
                      type: array
                      items:
                        type: string
                      description: Rate source code(s).
                    rates_src_code_name:
                      type: array
                      items:
                        type: string
                      description: Rate source code name(s).
                    rates_src_code_country:
                      type: array
                      items:
                        type: string
                      description: Rate source code country(s).
                    rates_time_profiles_id:
                      type: array
                      items:
                        type: integer
                      description: Rate time profile ID(s).
                    packages_id:
                      type: array
                      items:
                        type: integer
                      description: Package ID(s).
                    quality_asr_cur:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: ASR (current), given as a range.
                    quality_asr_std:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: ASR (standard), given as a range.
                    quality_acd_cur:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: ACD (current), given as a range.
                    quality_acd_std:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: ACD (standard), given as a range.
                    quality_pdd_avg:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: PDD (average), given as a range.
                    quality_scd_avg:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: SCD (average), given as a range.
                    quantity_total:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: integer
                      example:
                      - 1
                      - 9
                      description: Total events quantity, given as a range.
                    quantity_notzero:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: integer
                      example:
                      - 1
                      - 9
                      description: Not zero events quantity, given as a range.
                    quantity_success:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: integer
                      example:
                      - 1
                      - 9
                      description: Successful events quantity, given as a range.
                    quantity_busy:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: integer
                      example:
                      - 1
                      - 9
                      description: Busy events quantity, given as a range.
                    quantity_nochannel:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: integer
                      example:
                      - 1
                      - 9
                      description: No channel events quantity, given as a range.
                    quantity_error:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: integer
                      example:
                      - 1
                      - 9
                      description: Error events quantity, given as a range.
                    volume_total:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: Total volume, given as a range.
                    volume_rated:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: Rated volume (out of subscriptions), given as a
                        range.
                    volume_package:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: In-subscription volume, given as a range.
                    cost_rated:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: Rated cost (out of subscriptions), given as a range.
                    cost_rated_additive:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: Cost by additive rates, given as a range.
                    cost_rated_pay_setup:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: Setup fee total, given as a range.
                    cost_taxes:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: Taxes total, given as a range.
                    cost_package:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: Cost by subscriptions (for cash-based subscriptions),
                        given as a range.
                    rates_value_avg:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: Average rate value, given as a range.
                    payment_direction:
                      type: string
                      enum:
                      - in
                      - out
                      description: Payment direction. A special filter used mostly
                        for invoicing. For example, `out` will include all events
                        that customer paid for - outgoing or paid incoming.
                  required:
                  - date
                  dependentRequired: {}
                  description: Filters for report.
                return_fields:
                  type: array
                  items:
                    type: string
                    enum:
                    - date_year
                    - date_month
                    - date_day
                    - date_hour
                    - record_origin
                    - record_result_code
                    - record_tags
                    - clients_matched
                    - rates_matched
                    - services_id
                    - services_name
                    - services_units_id
                    - services_precision_volume
                    - equipment_id
                    - equipment_name
                    - equipment_tag
                    - companies_id
                    - companies_name
                    - legal_entities_id
                    - legal_entities_name
                    - owner_users_id
                    - owner_users_fullname
                    - clients_id
                    - clients_name
                    - clients_type
                    - clients_tags
                    - accounts_id
                    - accounts_name
                    - accounts_tags
                    - currencies_id
                    - currencies_precision_details
                    - currencies_precision_rates
                    - rates_id
                    - rates_code
                    - rates_code_name
                    - rates_code_country
                    - rates_src_code
                    - rates_src_code_name
                    - rates_src_code_country
                    - rates_value
                    - rates_value_additive
                    - rates_pay_setup
                    - rates_time_profiles_id
                    - rates_time_profiles_name
                    - packages_id
                    - packages_name
                    - date_min
                    - date_max
                    - quality_asr_cur
                    - quality_asr_std
                    - quality_acd_cur
                    - quality_acd_std
                    - quality_pdd_avg
                    - quality_pdd_total
                    - quality_scd_avg
                    - quality_scd_total
                    - quantity_total
                    - quantity_notzero
                    - quantity_success
                    - quantity_busy
                    - quantity_nochannel
                    - quantity_error
                    - volume_total
                    - volume_rated
                    - volume_package
                    - cost_rated
                    - cost_rated_additive
                    - cost_rated_pay_setup
                    - cost_taxes
                    - cost_package
                    - rates_value_avg
                  description: "List of fields to include in the response. Fields\
                    \ can be:\n* Aggregated fields (e.g., total quantity, total duration)\
                    \ - provide\n    summarized values.\n* Singular fields (e.g.,\
                    \ client ID, equipment ID) - define\n    how the data is grouped."
                comparison_mode:
                  type:
                  - string
                  - 'null'
                  enum:
                  - previous-period
                  - previous-day
                  - previous-week
                  - previous-month
                  - previous-year
                  default: null
                  description: Comparison mode for the historical data.
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - accounts_id
                    - -accounts_id
                    - accounts_name
                    - -accounts_name
                    - accounts_tags
                    - -accounts_tags
                    - clients_id
                    - -clients_id
                    - clients_matched
                    - -clients_matched
                    - clients_name
                    - -clients_name
                    - clients_tags
                    - -clients_tags
                    - clients_type
                    - -clients_type
                    - companies_id
                    - -companies_id
                    - companies_name
                    - -companies_name
                    - cost_package
                    - -cost_package
                    - cost_rated
                    - -cost_rated
                    - cost_rated_additive
                    - -cost_rated_additive
                    - cost_rated_pay_setup
                    - -cost_rated_pay_setup
                    - cost_taxes
                    - -cost_taxes
                    - currencies_id
                    - -currencies_id
                    - currencies_precision_details
                    - -currencies_precision_details
                    - currencies_precision_rates
                    - -currencies_precision_rates
                    - date_day
                    - -date_day
                    - date_hour
                    - -date_hour
                    - date_max
                    - -date_max
                    - date_min
                    - -date_min
                    - date_month
                    - -date_month
                    - date_year
                    - -date_year
                    - equipment_id
                    - -equipment_id
                    - equipment_name
                    - -equipment_name
                    - equipment_tag
                    - -equipment_tag
                    - legal_entities_id
                    - -legal_entities_id
                    - legal_entities_name
                    - -legal_entities_name
                    - owner_users_fullname
                    - -owner_users_fullname
                    - owner_users_id
                    - -owner_users_id
                    - packages_id
                    - -packages_id
                    - packages_name
                    - -packages_name
                    - quality_acd_cur
                    - -quality_acd_cur
                    - quality_acd_std
                    - -quality_acd_std
                    - quality_asr_cur
                    - -quality_asr_cur
                    - quality_asr_std
                    - -quality_asr_std
                    - quality_pdd_avg
                    - -quality_pdd_avg
                    - quality_pdd_total
                    - -quality_pdd_total
                    - quality_scd_avg
                    - -quality_scd_avg
                    - quality_scd_total
                    - -quality_scd_total
                    - quantity_busy
                    - -quantity_busy
                    - quantity_error
                    - -quantity_error
                    - quantity_nochannel
                    - -quantity_nochannel
                    - quantity_notzero
                    - -quantity_notzero
                    - quantity_success
                    - -quantity_success
                    - quantity_total
                    - -quantity_total
                    - rates_code
                    - -rates_code
                    - rates_code_country
                    - -rates_code_country
                    - rates_code_name
                    - -rates_code_name
                    - rates_id
                    - -rates_id
                    - rates_matched
                    - -rates_matched
                    - rates_pay_setup
                    - -rates_pay_setup
                    - rates_src_code
                    - -rates_src_code
                    - rates_src_code_country
                    - -rates_src_code_country
                    - rates_src_code_name
                    - -rates_src_code_name
                    - rates_time_profiles_id
                    - -rates_time_profiles_id
                    - rates_time_profiles_name
                    - -rates_time_profiles_name
                    - rates_value
                    - -rates_value
                    - rates_value_additive
                    - -rates_value_additive
                    - rates_value_avg
                    - -rates_value_avg
                    - record_origin
                    - -record_origin
                    - record_result_code
                    - -record_result_code
                    - record_tags
                    - -record_tags
                    - services_id
                    - -services_id
                    - services_name
                    - -services_name
                    - services_precision_volume
                    - -services_precision_volume
                    - services_units_id
                    - -services_units_id
                    - volume_package
                    - -volume_package
                    - volume_rated
                    - -volume_rated
                    - volume_total
                    - -volume_total
                  default: []
                  description: 'List of fields to order results by. Any fields used
                    in this

                    list should be present in `return_fields`.'
                limit:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Number of rows to return. It is typically used with
                    `order`

                    argument to get top X rows ranked by some attribute.'
                grouping_mode:
                  type:
                  - string
                  - 'null'
                  enum:
                  - rollup
                  - totals
                  default: null
                  description: "Grouping mode for aggregation:\n* `rollup` - the report\
                    \ will include intermediate subtotals and\n    full totals aside\
                    \ from regular records.\n* `totals` - the report will include\
                    \ regular records and top-level\n    totals.\n* `null` - the report\
                    \ will include only regular records."
                currencies_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Currency ID to convert all returned monetary values
                    to.

                    If not set, data will be returned as it was originally billed.'
                code_decks_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Code deck ID to use for providing code name and country

                    for destination codes. If not set, the code decks of the rate

                    tables used during billing will be used.'
                src_code_decks_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Code deck ID to use for providing code name and

                    country for source codes. If not set, the code decks of the rate

                    tables used during billing will be used.'
                timezone:
                  type:
                  - string
                  - 'null'
                  format: timezone
                  default: null
                  description: 'Timezone to use for date-based aggregation. If not
                    set,

                    `UTC` will be used.'
              required:
              - filters
              - return_fields
              dependentRequired: {}
  /reports/xdrs_list/count:
    post:
      tags:
      - reports.xdrs_list
      operationId: reports.xdrs_list.count
      summary: Query report (count)
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the xDRs retrieved by the filters.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        reports.xdrs_list.count

        :::


        The method is used to count xDRs according to the filters and parameters.

        It is typically used to estimate the number of events before their actual

        pulling from the database.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                filters:
                  type: object
                  properties:
                    date:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: string
                        format: date-time
                      example:
                      - '2025-06-10T10:00:00.000Z'
                      - '2025-07-02T16:00:00.000Z'
                      description: Date range.
                    id:
                      type: array
                      items:
                        type: integer
                      description: xDR leg ID.
                    origin:
                      type: string
                      enum:
                      - orig
                      - term
                      description: xDR leg origin.
                    equipment_id:
                      type: array
                      items:
                        type: integer
                      description: Equipment ID.
                    result_code:
                      type: array
                      items:
                        type: integer
                      description: xDR leg result code.
                    result_status:
                      type: array
                      items:
                        type: string
                        enum:
                        - success
                        - busy
                        - nochannel
                        - error
                      description: xDR leg result status. Determined by the result
                        code.
                    session_id:
                      type: array
                      items:
                        type: string
                      description: xDR session ID.
                    volume:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: Event volume (duration). Defined as a range.
                    volume_notzero:
                      type: boolean
                      description: If `True`, only events with non-zero volume (duration)
                        will be returned.
                    pdd:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: PDD range.
                    scd:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: SCD range.
                    status:
                      type: string
                      enum:
                      - processed
                      - in_rerating
                      - new
                      description: xDR processing status.
                    src_party_id_ext:
                      type: string
                      description: Source party ID.
                    dst_party_id_ext:
                      type: string
                      description: Destination party ID.
                    src_party_id_bill:
                      type: string
                      description: Source party ID pre-processed by equipment for
                        billing.
                    dst_party_id_bill:
                      type: string
                      description: Destination party ID pre-processed by equipment
                        for billing.
                    billed_services_id:
                      type: array
                      items:
                        type: integer
                      description: Service ID(s).
                    billed_companies_id:
                      type: array
                      items:
                        type: integer
                      description: Partition ID(s) of the client.
                    owner_users_id:
                      type: array
                      items:
                        type: integer
                      description: Owner user ID(s) of the client.
                    billed_owner_companies_id:
                      type: array
                      items:
                        type: integer
                      description: Partition ID(s) of the owner user.
                    billed_legal_entities_id:
                      type: array
                      items:
                        type: integer
                      description: Legal entity ID(s) of the client.
                    billed_clients_id:
                      type: array
                      items:
                        type: integer
                      description: Client ID(s).
                    billed_accounts_id:
                      type: array
                      items:
                        type: integer
                      description: Account ID(s) of the client.
                    billed_src_party_id:
                      type: string
                      description: Source party ID as used for billing.
                    billed_dst_party_id:
                      type: string
                      description: Destination party ID as used for billing.
                    billed_rates_id:
                      type: array
                      items:
                        type: integer
                      description: Rate ID(s) used for billing.
                    billed_volume:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: Billed volume (duration).
                    billed_currencies_id:
                      type: array
                      items:
                        type: integer
                      description: Currency ID(s) used for billing.
                    billed_cost_net:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: Billed cost (net).
                    billed_cost_tax:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: Billed tax value.
                    billed_tags:
                      type: array
                      items:
                        type: string
                      description: Dynamic tags of the xDR after billing.
                    billed_clients_matched:
                      type: boolean
                      description: If `True` returns only xDRs where client has been
                        successfully identified. If `False` returns only xDRs where
                        client has not been identified. If not given, the filtering
                        is not applied.
                    billed_rates_matched:
                      type: string
                      enum:
                      - matched
                      - deleted
                      - mismatched
                      description: Defines the match status of the rate used for billing.
                        If not given, the filtering is not applied.
                    clients_call_shops_id:
                      type: array
                      items:
                        type: integer
                      description: DEPRECATED. Call shop ID(s).
                    clients_tags:
                      type: array
                      items:
                        type: string
                      description: Client tag(s).
                    accounts_tags:
                      type: array
                      items:
                        type: string
                      description: Account tag(s).
                    clients_type:
                      type: array
                      items:
                        type: integer
                        enum:
                        - 0
                        - 3
                        - 10
                      description: Client type(s).
                    rates_value:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: Rate value range.
                    rates_pay_setup:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: Setup fee range.
                    rates_time_profiles_id:
                      type: array
                      items:
                        type: integer
                      description: Time profile ID(s).
                    rates_dst_code:
                      type: array
                      items:
                        type: string
                      description: Destination rate code(s).
                    rates_dst_code_name:
                      type: array
                      items:
                        type: string
                      description: Destination rate code name(s).
                    rates_dst_code_country:
                      type: array
                      items:
                        type: string
                      description: Destination rate code country(s).
                    rates_src_code:
                      type: array
                      items:
                        type: string
                      description: Source rate code(s).
                    rates_src_code_name:
                      type: array
                      items:
                        type: string
                      description: Source rate code name(s).
                    rates_src_code_country:
                      type: array
                      items:
                        type: string
                      description: Source rate code country(s).
                    packages_id:
                      type: array
                      items:
                        type: integer
                      description: Package ID(s) used for billing.
                    billed_cpl_money:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: Cost that has been used from the subscription entitlement.
                    billed_cpl_volume:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: Volume that has been used from the subscription
                        entitlement.
                    without_packages:
                      type: boolean
                      description: If `True`, returns only xDRs that have not been
                        billed through packages.
                    invoices_type:
                      type: string
                      enum:
                      - in
                      - out
                      description: Special filter for invoicing purposes. If given,
                        returns only xDRs applicable to the given invoice type.
                    include_zero_cost:
                      type: boolean
                      description: Special filter for invoicing purposes. If `True`,
                        returns only xDRs with non-zero cost or billed through packages.
                    synced_in_summary:
                      type: boolean
                      description: If `True`, returns only xDRs that have been synced
                        in the summary table.
                  required:
                  - date
                  dependentRequired: {}
                  description: Filters for data querying.
                dst_code_decks_id:
                  type:
                  - integer
                  - 'null'
                  description: Code deck ID to use for destination codes. If not set,
                    destination codes will be returned according to the code deck
                    of the rate table used for billing.
                  default: null
              required:
              - filters
              dependentRequired: {}
  /reports/xdrs_list:
    post:
      tags:
      - reports.xdrs_list
      operationId: reports.xdrs_list.query
      summary: Query report
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of xDR objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        reports.xdrs_list.query

        :::


        Method generates xDRs List and returns the data requested. You

        have to specify exact list of fields that you want to get in return

        using ``return_fields`` argument.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                return_fields:
                  type: array
                  items:
                    type: string
                    enum:
                    - status
                    - id
                    - table_prefix
                    - equipment_id
                    - collectors_id
                    - services_code
                    - units_id
                    - unique_id
                    - session_id
                    - leg_id
                    - origin
                    - subscriber_host
                    - subscriber_id
                    - src_party_id_ext
                    - dst_party_id_ext
                    - src_party_id_bill
                    - dst_party_id_bill
                    - setup_time
                    - start_time
                    - stop_time
                    - volume
                    - volume_raw
                    - pdd
                    - scd
                    - result_code
                    - result_status
                    - switch_code
                    - custom
                    - xdrs_extra
                    - billed_id
                    - billed_dt
                    - billed_dt_precise
                    - billed_clients_matched
                    - billed_rates_matched
                    - billed_parents_companies_ids
                    - billed_owner_companies_id
                    - billed_legal_entities_id
                    - billed_clients_id
                    - billed_accounts_id
                    - billed_rates_id
                    - billed_services_id
                    - billed_src_party_id
                    - billed_dst_party_id
                    - billed_tags
                    - billed_paid
                    - billed_volume
                    - billed_volume_raw
                    - billed_currencies_id
                    - billed_cost_net
                    - billed_cost_net_raw
                    - billed_cost_net_breakdown
                    - billed_cost_net_breakdown_details
                    - billed_cost_net_breakdown_raw
                    - billed_cost_tax
                    - billed_cost_tax_raw
                    - billed_cost_tax_breakdown
                    - billed_cost_tax_breakdown_details
                    - billed_cost_tax_breakdown_raw
                    - billed_cost_draft
                    - billed_cost_draft_raw
                    - billed_cpl
                    - billed_cpl_id
                    - billed_cpl_volume
                    - billed_cpl_volume_raw
                    - billed_cpl_money
                    - services_name
                    - services_units_id
                    - companies_name
                    - legal_entities_name
                    - equipment_name
                    - time_profiles_name
                    - clients_name
                    - clients_tags
                    - clients_type
                    - owner_users_id
                    - owner_users_fullname
                    - clients_hide_numbers
                    - accounts_name
                    - accounts_tags
                    - packages_id
                    - packages_name
                    - rates_value
                    - rates_pay_setup
                    - rates_src_code
                    - rates_dst_code
                    - rates_currencies_id
                    - rates_src_code_name
                    - rates_src_code_country
                    - rates_dst_code_name
                    - rates_dst_code_country
                    - rates_time_profiles_id
                    - synced_in_summary
                  description: List of fields to return.
                filters:
                  type: object
                  properties:
                    date:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: string
                        format: date-time
                      example:
                      - '2025-06-10T10:00:00.000Z'
                      - '2025-07-02T16:00:00.000Z'
                      description: Date range.
                    id:
                      type: array
                      items:
                        type: integer
                      description: xDR leg ID.
                    origin:
                      type: string
                      enum:
                      - orig
                      - term
                      description: xDR leg origin.
                    equipment_id:
                      type: array
                      items:
                        type: integer
                      description: Equipment ID.
                    result_code:
                      type: array
                      items:
                        type: integer
                      description: xDR leg result code.
                    result_status:
                      type: array
                      items:
                        type: string
                        enum:
                        - success
                        - busy
                        - nochannel
                        - error
                      description: xDR leg result status. Determined by the result
                        code.
                    session_id:
                      type: array
                      items:
                        type: string
                      description: xDR session ID.
                    volume:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: Event volume (duration). Defined as a range.
                    volume_notzero:
                      type: boolean
                      description: If `True`, only events with non-zero volume (duration)
                        will be returned.
                    pdd:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: PDD range.
                    scd:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: SCD range.
                    status:
                      type: string
                      enum:
                      - processed
                      - in_rerating
                      - new
                      description: xDR processing status.
                    src_party_id_ext:
                      type: string
                      description: Source party ID.
                    dst_party_id_ext:
                      type: string
                      description: Destination party ID.
                    src_party_id_bill:
                      type: string
                      description: Source party ID pre-processed by equipment for
                        billing.
                    dst_party_id_bill:
                      type: string
                      description: Destination party ID pre-processed by equipment
                        for billing.
                    billed_services_id:
                      type: array
                      items:
                        type: integer
                      description: Service ID(s).
                    billed_companies_id:
                      type: array
                      items:
                        type: integer
                      description: Partition ID(s) of the client.
                    owner_users_id:
                      type: array
                      items:
                        type: integer
                      description: Owner user ID(s) of the client.
                    billed_owner_companies_id:
                      type: array
                      items:
                        type: integer
                      description: Partition ID(s) of the owner user.
                    billed_legal_entities_id:
                      type: array
                      items:
                        type: integer
                      description: Legal entity ID(s) of the client.
                    billed_clients_id:
                      type: array
                      items:
                        type: integer
                      description: Client ID(s).
                    billed_accounts_id:
                      type: array
                      items:
                        type: integer
                      description: Account ID(s) of the client.
                    billed_src_party_id:
                      type: string
                      description: Source party ID as used for billing.
                    billed_dst_party_id:
                      type: string
                      description: Destination party ID as used for billing.
                    billed_rates_id:
                      type: array
                      items:
                        type: integer
                      description: Rate ID(s) used for billing.
                    billed_volume:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: Billed volume (duration).
                    billed_currencies_id:
                      type: array
                      items:
                        type: integer
                      description: Currency ID(s) used for billing.
                    billed_cost_net:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: Billed cost (net).
                    billed_cost_tax:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: Billed tax value.
                    billed_tags:
                      type: array
                      items:
                        type: string
                      description: Dynamic tags of the xDR after billing.
                    billed_clients_matched:
                      type: boolean
                      description: If `True` returns only xDRs where client has been
                        successfully identified. If `False` returns only xDRs where
                        client has not been identified. If not given, the filtering
                        is not applied.
                    billed_rates_matched:
                      type: string
                      enum:
                      - matched
                      - deleted
                      - mismatched
                      description: Defines the match status of the rate used for billing.
                        If not given, the filtering is not applied.
                    clients_call_shops_id:
                      type: array
                      items:
                        type: integer
                      description: DEPRECATED. Call shop ID(s).
                    clients_tags:
                      type: array
                      items:
                        type: string
                      description: Client tag(s).
                    accounts_tags:
                      type: array
                      items:
                        type: string
                      description: Account tag(s).
                    clients_type:
                      type: array
                      items:
                        type: integer
                        enum:
                        - 0
                        - 3
                        - 10
                      description: Client type(s).
                    rates_value:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: Rate value range.
                    rates_pay_setup:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: Setup fee range.
                    rates_time_profiles_id:
                      type: array
                      items:
                        type: integer
                      description: Time profile ID(s).
                    rates_dst_code:
                      type: array
                      items:
                        type: string
                      description: Destination rate code(s).
                    rates_dst_code_name:
                      type: array
                      items:
                        type: string
                      description: Destination rate code name(s).
                    rates_dst_code_country:
                      type: array
                      items:
                        type: string
                      description: Destination rate code country(s).
                    rates_src_code:
                      type: array
                      items:
                        type: string
                      description: Source rate code(s).
                    rates_src_code_name:
                      type: array
                      items:
                        type: string
                      description: Source rate code name(s).
                    rates_src_code_country:
                      type: array
                      items:
                        type: string
                      description: Source rate code country(s).
                    packages_id:
                      type: array
                      items:
                        type: integer
                      description: Package ID(s) used for billing.
                    billed_cpl_money:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: Cost that has been used from the subscription entitlement.
                    billed_cpl_volume:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        format: decimal
                      example:
                      - 0.1
                      - 10.1
                      description: Volume that has been used from the subscription
                        entitlement.
                    without_packages:
                      type: boolean
                      description: If `True`, returns only xDRs that have not been
                        billed through packages.
                    invoices_type:
                      type: string
                      enum:
                      - in
                      - out
                      description: Special filter for invoicing purposes. If given,
                        returns only xDRs applicable to the given invoice type.
                    include_zero_cost:
                      type: boolean
                      description: Special filter for invoicing purposes. If `True`,
                        returns only xDRs with non-zero cost or billed through packages.
                    synced_in_summary:
                      type: boolean
                      description: If `True`, returns only xDRs that have been synced
                        in the summary table.
                  required:
                  - date
                  dependentRequired: {}
                  description: Filters for data querying.
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - accounts_name
                    - -accounts_name
                    - accounts_tags
                    - -accounts_tags
                    - billed_accounts_id
                    - -billed_accounts_id
                    - billed_clients_id
                    - -billed_clients_id
                    - billed_clients_matched
                    - -billed_clients_matched
                    - billed_cost_draft
                    - -billed_cost_draft
                    - billed_cost_draft_raw
                    - -billed_cost_draft_raw
                    - billed_cost_net
                    - -billed_cost_net
                    - billed_cost_net_breakdown
                    - -billed_cost_net_breakdown
                    - billed_cost_net_breakdown_details
                    - -billed_cost_net_breakdown_details
                    - billed_cost_net_breakdown_raw
                    - -billed_cost_net_breakdown_raw
                    - billed_cost_net_raw
                    - -billed_cost_net_raw
                    - billed_cost_tax
                    - -billed_cost_tax
                    - billed_cost_tax_breakdown
                    - -billed_cost_tax_breakdown
                    - billed_cost_tax_breakdown_details
                    - -billed_cost_tax_breakdown_details
                    - billed_cost_tax_breakdown_raw
                    - -billed_cost_tax_breakdown_raw
                    - billed_cost_tax_raw
                    - -billed_cost_tax_raw
                    - billed_cpl
                    - -billed_cpl
                    - billed_cpl_id
                    - -billed_cpl_id
                    - billed_cpl_money
                    - -billed_cpl_money
                    - billed_cpl_volume
                    - -billed_cpl_volume
                    - billed_cpl_volume_raw
                    - -billed_cpl_volume_raw
                    - billed_currencies_id
                    - -billed_currencies_id
                    - billed_dst_party_id
                    - -billed_dst_party_id
                    - billed_dt
                    - -billed_dt
                    - billed_dt_precise
                    - -billed_dt_precise
                    - billed_id
                    - -billed_id
                    - billed_legal_entities_id
                    - -billed_legal_entities_id
                    - billed_owner_companies_id
                    - -billed_owner_companies_id
                    - billed_paid
                    - -billed_paid
                    - billed_parents_companies_ids
                    - -billed_parents_companies_ids
                    - billed_rates_id
                    - -billed_rates_id
                    - billed_rates_matched
                    - -billed_rates_matched
                    - billed_services_id
                    - -billed_services_id
                    - billed_src_party_id
                    - -billed_src_party_id
                    - billed_tags
                    - -billed_tags
                    - billed_volume
                    - -billed_volume
                    - billed_volume_raw
                    - -billed_volume_raw
                    - clients_hide_numbers
                    - -clients_hide_numbers
                    - clients_name
                    - -clients_name
                    - clients_tags
                    - -clients_tags
                    - clients_type
                    - -clients_type
                    - collectors_id
                    - -collectors_id
                    - companies_name
                    - -companies_name
                    - custom
                    - -custom
                    - dst_party_id_bill
                    - -dst_party_id_bill
                    - dst_party_id_ext
                    - -dst_party_id_ext
                    - equipment_id
                    - -equipment_id
                    - equipment_name
                    - -equipment_name
                    - id
                    - -id
                    - leg_id
                    - -leg_id
                    - legal_entities_name
                    - -legal_entities_name
                    - origin
                    - -origin
                    - owner_users_fullname
                    - -owner_users_fullname
                    - owner_users_id
                    - -owner_users_id
                    - packages_id
                    - -packages_id
                    - packages_name
                    - -packages_name
                    - pdd
                    - -pdd
                    - rates_currencies_id
                    - -rates_currencies_id
                    - rates_dst_code
                    - -rates_dst_code
                    - rates_dst_code_country
                    - -rates_dst_code_country
                    - rates_dst_code_name
                    - -rates_dst_code_name
                    - rates_pay_setup
                    - -rates_pay_setup
                    - rates_src_code
                    - -rates_src_code
                    - rates_src_code_country
                    - -rates_src_code_country
                    - rates_src_code_name
                    - -rates_src_code_name
                    - rates_time_profiles_id
                    - -rates_time_profiles_id
                    - rates_value
                    - -rates_value
                    - result_code
                    - -result_code
                    - result_status
                    - -result_status
                    - scd
                    - -scd
                    - services_code
                    - -services_code
                    - services_name
                    - -services_name
                    - services_units_id
                    - -services_units_id
                    - session_id
                    - -session_id
                    - setup_time
                    - -setup_time
                    - src_party_id_bill
                    - -src_party_id_bill
                    - src_party_id_ext
                    - -src_party_id_ext
                    - start_time
                    - -start_time
                    - status
                    - -status
                    - stop_time
                    - -stop_time
                    - subscriber_host
                    - -subscriber_host
                    - subscriber_id
                    - -subscriber_id
                    - switch_code
                    - -switch_code
                    - synced_in_summary
                    - -synced_in_summary
                    - table_prefix
                    - -table_prefix
                    - time_profiles_name
                    - -time_profiles_name
                    - unique_id
                    - -unique_id
                    - units_id
                    - -units_id
                    - volume
                    - -volume
                    - volume_raw
                    - -volume_raw
                    - xdrs_extra
                    - -xdrs_extra
                  description: List of columns to order results by.
                  default: []
                src_code_decks_id:
                  type:
                  - integer
                  - 'null'
                  description: Code deck ID to use for source codes. If not set, source
                    codes will be returned according to the code deck of the rate
                    table used for billing.
                  default: null
                dst_code_decks_id:
                  type:
                  - integer
                  - 'null'
                  description: Code deck ID to use for destination codes. If not set,
                    destination codes will be returned according to the code deck
                    of the rate table used for billing.
                  default: null
                anonymize_code_decks_id:
                  type:
                  - integer
                  - 'null'
                  description: Code deck ID to use for anonymization. If not set,
                    anonymization will not be performed. During anonymization, all
                    rows with dst/src codes present in the code deck will be completely
                    anonymized. For other codes, dst fields will be hidden according
                    to the `invoicing.hide_numbers_length` system setting.
                  default: null
                currencies_id:
                  type:
                  - integer
                  - 'null'
                  description: If defined, all monetary values will be converted to
                    this currency. Otherwise, monetary values will be returned in
                    the currency that was used for billing.
                  default: null
                timezone:
                  type:
                  - string
                  - 'null'
                  format: timezone
                  description: Timezone to return data in. If not set, data will be
                    returned in the timezone defined for the current API user or system
                    default.
                  default: null
                export:
                  type:
                  - object
                  - 'null'
                  properties:
                    file_format:
                      type: string
                      enum:
                      - csv
                      - xlsx
                    filename:
                      type: string
                    compress:
                      type: boolean
                      default: false
                    locale:
                      type: string
                      enum:
                      - en
                      - es
                      - et
                      - lt
                      - lv
                      - pl
                      - ua
                      default: en
                    template:
                      type: string
                      enum:
                      - default
                      - eek
                      default: default
                  required:
                  - file_format
                  - filename
                  dependentRequired: {}
                  description: Export settings. If defined, the result rows will be
                    written to the file.
                  default: null
              required:
              - return_fields
              - filters
              dependentRequired: {}
  /routing/analysis:
    post:
      tags:
      - routing.analysis
      operationId: routing.analysis.query
      summary: Query analysis
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Object containing structured report results.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        routing.analysis.query

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                services_code:
                  type: string
                  description: Service identification code.
                clients_id:
                  type: integer
                  description: 'Client ID to run analysis for. Either `clients_id`

                    or `accounts_id` could be specified.'
                accounts_id:
                  type: integer
                  description: 'Account ID to run analysis for. Either `clients_id`

                    or `accounts_id` could be specified.'
                dst_party_id:
                  type: string
                  description: Destination party ID (destination number).
                src_party_id:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Source party ID (source number).
                equipment_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: Equipment ID.
                routing_plans_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Routing plan ID. If defined, will be used for

                    analysis instead of the routing plan assigned to the client

                    or account. Can be used to simulate routing with a different

                    routing plan.'
                dynamic_tags:
                  type: array
                  items:
                    type: string
                  default: []
                  description: Additional dynamic tags to use for routing.
                accepted_only:
                  type: boolean
                  default: true
                  description: If `True`, only accepted routes will be returned.
                skip_reject_reasons:
                  type: array
                  items:
                    type: string
                    enum:
                    - company_active
                    - client_active
                    - account_active
                    - rule_active
                    - num_length
                    - orig_tags
                    - term_tags
                    - company_match
                    - profitable
                    - rate_increments
                    - rate_blocked
                    - stop_hunting
                    - credit_limit
                    - vendor_qty
                    - quality
                    - capacity_company
                    - capacity_client
                    - capacity_account
                    - capacity_rule
                    - traffic_processing
                    - traffic_processing_orig
                  default: []
                  description: List of reject reasons to skip from results.
              required:
              - services_code
              - clients_id
              - accounts_id
              - dst_party_id
              dependentRequired: {}
  /routing/plans:
    post:
      tags:
      - routing.plans
      operationId: routing.plans.create
      summary: Create plan
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Routing plan object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        routing.plans.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 128
                  description: Name.
                companies_id:
                  type: integer
                  description: Partition ID.
                profit_margin:
                  type: string
                  maxLength: 32
                  description: 'Minimum profit margin allowed. To be specified in
                    the

                    system currency or as a percent value. The value is used for all

                    rules of the routing plan, that don''t have their own profit margin.'
                vendor_qty:
                  type: integer
                  minimum: 0
                  maximum: 2147483647
                  description: 'Number of routes from the same vendor that can be
                    returned

                    within routing request.'
                match_increments:
                  type: string
                  enum:
                  - disabled
                  - dynamic-only
                  - all
                  description: 'Determines if billing increments of the originator

                    and terminator should match. The matching is done in the way to

                    avoid profit loss in case if terminator may have billing increments

                    that will lead to profit loss (e.g. vendor has 60/60 billing

                    increment, while originator has 1/1, at the same time vice versa

                    is allowed).

                    * If `disabled`, no check is done.

                    * If `dynamic-only`, the check is done only for the rules with

                    `dynamic` type.

                    * If `all`, the check is done for all rules.'
                code_decks_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: Code deck ID.
                parent_routing_plans_ids:
                  type: array
                  items:
                    type: integer
                  default: []
                  description: Parent routing plan ID(s).
                dr_order:
                  type: string
                  enum:
                  - code
                  - appeal
                  default: code
                  description: "Sorting for `dynamic` routing rules:\n* In `code`\
                    \ mode, the rules are sorted by code value first and\n  then by\
                    \ appeal value.\n* In `appeal` mode, the rules are sorted by appeal\
                    \ value first for\n  all rules with matching code and then by\
                    \ code value for routes with\n  same appeal value."
                hunting:
                  type: string
                  enum:
                  - longest
                  - continue
                  default: longest
                  description: "Rules hunting mode:\n* In `longest` mode, only the\
                    \ rule for the longest matching code is\n  used.\n* In `continue`\
                    \ mode, all matching rules are used."
                orig_companies_ids:
                  type:
                  - array
                  - 'null'
                  items:
                    type: integer
                  default: null
                  description: 'If not empty, the routing plan can be used only by

                    defined partition ID(s) and partition defined in `companies_id`.

                    Otherwise, the routing plan can be used by the clients of the

                    partition defined by the `companies_id` field and all its

                    sub-partitions.'
                term_companies_ids:
                  type:
                  - array
                  - 'null'
                  items:
                    type: integer
                  default: null
                  description: 'If not empty, the vendors selected within routing

                    request will be limited to the defined partition ID(s) and partition

                    defined in `companies_id`. Otherwise, the vendors selected within

                    routing request will be limited to the clients of the partition

                    defined by the `companies_id` field and all its sub-partitions.'
                loop_protection:
                  type: boolean
                  default: true
                  description: 'If `True`, the originator will be excluded from the
                    list

                    of the routes even if some of the rules defines routing to the

                    same originator.'
              required:
              - name
              - companies_id
              - profit_margin
              - vendor_qty
              - match_increments
              dependentRequired: {}
    get:
      tags:
      - routing.plans
      operationId: routing.plans.search
      summary: List plans
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of routing plan objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ":::note[JSON-RPC]\nrouting.plans.search\n:::\n\nThe function can\
        \ operate in two modes:\n    * `manage` - this is the default mode, which\
        \ implements standard\n        permissions check by partition allowed to the\
        \ user calling\n        the function.\n    * `use` - this is the special mode,\
        \ that filters only those routing\n        plans that can be used by the client\
        \ or client template, that\n        belong to the partition specified in `companies_id_usage`\n\
        \        parameter.\n\n:::tip Origination Limit\n\n* If \"Origination Limit\"\
        \ is defined for the routing plan, it can be used\n    by the entities belonging\
        \ to the partition of the routing plan or any\n    other partitions given\
        \ within the \"Origination Limit\".\n* If \"Origination Limit\" is not defined\
        \ for the routing plan, it can be\n    used by the entities belonging to the\
        \ partition of the routing plan or\n    any of its sub-partitions.\n\n:::"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - code_decks_name
                    - -code_decks_name
                    - dr_order
                    - -dr_order
                    - hunting
                    - -hunting
                    - id
                    - -id
                    - name
                    - -name
                  default: []
                  description: List of columns to order results by.
                q:
                  type: string
                  description: Quick search (wildcards allowed).
                id:
                  type: array
                  items:
                    type: integer
                  description: Routing plan ID.
                mode:
                  type: string
                  enum:
                  - manage
                  - use
                  default: manage
                  description: Search mode.
                companies_id:
                  type: array
                  items:
                    type: integer
                  description: Partition ID.
                skip_testing_plan:
                  type: boolean
                  default: false
                  description: 'If `True`, special routing plan intended for routes

                    testing "DR: Routes Testing" will be excluded from the result.'
                companies_id_usage:
                  type: integer
                  description: 'Partition ID of the entity (e.g. client, account,
                    etc.)

                    that will be using the routing plan. Parameter is required if

                    `mode` is set to `use`.'
                code_decks_id:
                  type: integer
                  description: Code deck ID.
                parent_routing_plans_ids:
                  type: array
                  items:
                    type: integer
                  description: Parent routing plans IDs.
                tags_overlap:
                  type: array
                  items:
                    type: string
                  description: 'Origination or termination tags of the routing rules

                    within the routing plan. Filters by at least one tag match.'
                s_clients_id:
                  type: integer
                  description: 'Client ID used for static routing rules within

                    the routing plan.'
                s_accounts_id:
                  type: integer
                  description: 'Account ID used for static routing rules within

                    the routing plan.'
                include_rules_count:
                  type: boolean
                  default: false
                  description: 'If `True`, counts of routing rules will be included

                    in the result.'
              required: []
              dependentRequired: {}
  /routing/plans/{id}:
    delete:
      tags:
      - routing.plans
      operationId: routing.plans.delete
      summary: Delete plan
      parameters:
      - in: path
        name: id
        schema:
          type: integer
          minimum: 0
        required: true
        description: Routing plan ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        routing.plans.delete

        :::


        '
    get:
      tags:
      - routing.plans
      operationId: routing.plans.get
      summary: Get plan
      parameters:
      - in: path
        name: id
        schema:
          type: integer
          minimum: 0
        required: true
        description: Routing plan ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Routing plan object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        routing.plans.get

        :::


        '
    patch:
      tags:
      - routing.plans
      operationId: routing.plans.update
      summary: Update plan
      parameters:
      - in: path
        name: id
        schema:
          type: integer
          minimum: 0
        required: true
        description: Routing plan ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        routing.plans.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 128
                  description: Name.
                companies_id:
                  type: integer
                  description: Partition ID.
                profit_margin:
                  type: string
                  maxLength: 32
                  description: 'Minimum profit margin allowed. To be specified in
                    the

                    system currency or as a percent value. The value is used for all

                    rules of the routing plan, that don''t have their own profit margin.'
                vendor_qty:
                  type: integer
                  minimum: 0
                  maximum: 2147483647
                  description: 'Number of routes from the same vendor that can be
                    returned

                    within routing request.'
                match_increments:
                  type: string
                  enum:
                  - disabled
                  - dynamic-only
                  - all
                  description: 'Determines if billing increments of the originator

                    and terminator should match. The matching is done in the way to

                    avoid profit loss in case if terminator may have billing increments

                    that will lead to profit loss (e.g. vendor has 60/60 billing

                    increment, while originator has 1/1, at the same time vice versa

                    is allowed).

                    * If `disabled`, no check is done.

                    * If `dynamic-only`, the check is done only for the rules with

                    `dynamic` type.

                    * If `all`, the check is done for all rules.'
                code_decks_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: Code deck ID.
                parent_routing_plans_ids:
                  type: array
                  items:
                    type: integer
                  default: []
                  description: Parent routing plan ID(s).
                dr_order:
                  type: string
                  enum:
                  - code
                  - appeal
                  default: code
                  description: "Sorting for `dynamic` routing rules:\n* In `code`\
                    \ mode, the rules are sorted by code value first and\n  then by\
                    \ appeal value.\n* In `appeal` mode, the rules are sorted by appeal\
                    \ value first for\n  all rules with matching code and then by\
                    \ code value for routes with\n  same appeal value."
                hunting:
                  type: string
                  enum:
                  - longest
                  - continue
                  default: longest
                  description: "Rules hunting mode:\n* In `longest` mode, only the\
                    \ rule for the longest matching code is\n  used.\n* In `continue`\
                    \ mode, all matching rules are used."
                orig_companies_ids:
                  type:
                  - array
                  - 'null'
                  items:
                    type: integer
                  default: null
                  description: 'If not empty, the routing plan can be used only by

                    defined partition ID(s) and partition defined in `companies_id`.

                    Otherwise, the routing plan can be used by the clients of the

                    partition defined by the `companies_id` field and all its

                    sub-partitions.'
                term_companies_ids:
                  type:
                  - array
                  - 'null'
                  items:
                    type: integer
                  default: null
                  description: 'If not empty, the vendors selected within routing

                    request will be limited to the defined partition ID(s) and partition

                    defined in `companies_id`. Otherwise, the vendors selected within

                    routing request will be limited to the clients of the partition

                    defined by the `companies_id` field and all its sub-partitions.'
                loop_protection:
                  type: boolean
                  default: true
                  description: 'If `True`, the originator will be excluded from the
                    list

                    of the routes even if some of the rules defines routing to the

                    same originator.'
              required:
              - name
              - companies_id
              - profit_margin
              - vendor_qty
              - match_increments
              dependentRequired: {}
  /routing/plans/rules:
    post:
      tags:
      - routing.plans.rules
      operationId: routing.plans.rules.create
      summary: Create rule
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Routing rule object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        routing.plans.rules.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                routing_plans_id:
                  type: integer
                  description: Routing plan ID.
                type:
                  type: string
                  enum:
                  - static
                  - dynamic
                  - did
                  description: Type.
                s_clients_id:
                  type: integer
                  description: Terminator client ID. For `static` type only.
                s_accounts_id:
                  type: integer
                  description: Terminator account ID. For `static` type only.
                routing_policies_id:
                  type: integer
                  description: Routing policy ID. For `dynamic` type only.
                profit_margin:
                  type: string
                  maxLength: 32
                  description: 'Minimum profit margin allowed. To be specified in
                    the

                    system currency or as a percent value.'
                time_profiles_id:
                  type: integer
                  description: Time profile ID.
                status:
                  type: string
                  enum:
                  - active
                  - disabled
                  default: active
                  description: Status.
                priority:
                  type: integer
                  minimum: 0
                  default: 0
                  description: Priority.
                code:
                  type:
                  - string
                  - 'null'
                  maxLength: 64
                  default: null
                  description: Destination code.
                code_name:
                  type:
                  - string
                  - 'null'
                  maxLength: 255
                  default: null
                  description: Destination code name.
                orig_tags_operator:
                  type: string
                  enum:
                  - any
                  - all
                  default: any
                  description: Operator for the originator tags.
                term_tags_operator:
                  type: string
                  enum:
                  - any
                  - all
                  default: any
                  description: Operator for the terminator tags.
                expiry_dt:
                  type:
                  - string
                  - 'null'
                  format: date-time
                  default: null
                  description: 'Expiry timestamp for the rule. After this timestamp
                    the rule

                    will become inactive and will be removed by the system.'
                s_balance:
                  type: integer
                  minimum: 0
                  maximum: 100
                  default: 100
                  description: 'Balancing rate. Used for the rules with the same priority.

                    The distribution is done in proportion according to the balancing

                    rate defined for the rule and sum of all balancing rates defined
                    for

                    the rules with the same priority.'
                asr_min:
                  type:
                  - number
                  - 'null'
                  format: decimal
                  default: null
                  description: 'Minimum ASR allowed. Routes with ASR lower than given
                    will

                    be rejected.'
                num_length_min:
                  type:
                  - integer
                  - 'null'
                  minimum: 0
                  default: null
                  description: 'Minimum length of the destination number that will
                    be

                    matched by this routing rule.'
                num_length_max:
                  type:
                  - integer
                  - 'null'
                  minimum: 0
                  default: null
                  description: 'Maximum length of the destination number that will
                    be

                    matched by this routing rule.'
                acd_min:
                  type:
                  - number
                  - 'null'
                  format: decimal
                  default: null
                  description: 'Minimum ACD allowed. Routes with ACD lower than given
                    will

                    be rejected.'
                capacity:
                  type:
                  - integer
                  - 'null'
                  minimum: 0
                  default: null
                  description: 'Maximum allowed capacity for each vendor under this
                    rule.

                    For the rules with `dynamic` type the capacity is applied to each

                    of the vendors individually.'
                hunted:
                  type: boolean
                  default: false
                  description: 'If `True`, once this rule is matched and accepted,
                    all the

                    following rules will be rejected.'
                orig_tags:
                  type: array
                  items:
                    type: string
                  default: []
                  description: Rule is applied only for originators with specified
                    tags.
                term_tags:
                  type: array
                  items:
                    type: string
                  default: []
                  description: Rule is applied only for terminators with specified
                    tags.
              required:
              - routing_plans_id
              - type
              - s_clients_id
              - s_accounts_id
              - routing_policies_id
              - profit_margin
              - time_profiles_id
              dependentRequired: {}
    get:
      tags:
      - routing.plans.rules
      operationId: routing.plans.rules.search
      summary: List rules
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of routing plan rule objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        routing.plans.rules.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - code
                    - -code
                    - code_name
                    - -code_name
                    - id
                    - -id
                    - priority
                    - -priority
                    - type
                    - -type
                  default: []
                  description: List of columns to order results by.
                q:
                  type: string
                  description: Quick search (wildcards allowed).
                routing_plans_id:
                  type: integer
                  description: Routing plan ID.
              required: []
              dependentRequired: {}
  /routing/plans/rules/{id}:
    delete:
      tags:
      - routing.plans.rules
      operationId: routing.plans.rules.delete
      summary: Delete rule
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Routing rule ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        routing.plans.rules.delete

        :::


        '
    get:
      tags:
      - routing.plans.rules
      operationId: routing.plans.rules.get
      summary: Get rule
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Routing rule ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Routing plan rule object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        routing.plans.rules.get

        :::


        '
    patch:
      tags:
      - routing.plans.rules
      operationId: routing.plans.rules.update
      summary: Update rule
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Routing rule ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        routing.plans.rules.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                routing_plans_id:
                  type: integer
                  description: Routing plan ID.
                type:
                  type: string
                  enum:
                  - static
                  - dynamic
                  - did
                  description: Type.
                s_clients_id:
                  type: integer
                  description: Terminator client ID. For `static` type only.
                s_accounts_id:
                  type: integer
                  description: Terminator account ID. For `static` type only.
                routing_policies_id:
                  type: integer
                  description: Routing policy ID. For `dynamic` type only.
                profit_margin:
                  type: string
                  maxLength: 32
                  description: 'Minimum profit margin allowed. To be specified in
                    the

                    system currency or as a percent value.'
                time_profiles_id:
                  type: integer
                  description: Time profile ID.
                status:
                  type: string
                  enum:
                  - active
                  - disabled
                  default: active
                  description: Status.
                priority:
                  type: integer
                  minimum: 0
                  default: 0
                  description: Priority.
                code:
                  type:
                  - string
                  - 'null'
                  maxLength: 64
                  default: null
                  description: Destination code.
                code_name:
                  type:
                  - string
                  - 'null'
                  maxLength: 255
                  default: null
                  description: Destination code name.
                orig_tags_operator:
                  type: string
                  enum:
                  - any
                  - all
                  default: any
                  description: Operator for the originator tags.
                term_tags_operator:
                  type: string
                  enum:
                  - any
                  - all
                  default: any
                  description: Operator for the terminator tags.
                expiry_dt:
                  type:
                  - string
                  - 'null'
                  format: date-time
                  default: null
                  description: 'Expiry timestamp for the rule. After this timestamp
                    the rule

                    will become inactive and will be removed by the system.'
                s_balance:
                  type: integer
                  minimum: 0
                  maximum: 100
                  default: 100
                  description: 'Balancing rate. Used for the rules with the same priority.

                    The distribution is done in proportion according to the balancing

                    rate defined for the rule and sum of all balancing rates defined
                    for

                    the rules with the same priority.'
                asr_min:
                  type:
                  - number
                  - 'null'
                  format: decimal
                  default: null
                  description: 'Minimum ASR allowed. Routes with ASR lower than given
                    will

                    be rejected.'
                num_length_min:
                  type:
                  - integer
                  - 'null'
                  minimum: 0
                  default: null
                  description: 'Minimum length of the destination number that will
                    be

                    matched by this routing rule.'
                num_length_max:
                  type:
                  - integer
                  - 'null'
                  minimum: 0
                  default: null
                  description: 'Maximum length of the destination number that will
                    be

                    matched by this routing rule.'
                acd_min:
                  type:
                  - number
                  - 'null'
                  format: decimal
                  default: null
                  description: 'Minimum ACD allowed. Routes with ACD lower than given
                    will

                    be rejected.'
                capacity:
                  type:
                  - integer
                  - 'null'
                  minimum: 0
                  default: null
                  description: 'Maximum allowed capacity for each vendor under this
                    rule.

                    For the rules with `dynamic` type the capacity is applied to each

                    of the vendors individually.'
                hunted:
                  type: boolean
                  default: false
                  description: 'If `True`, once this rule is matched and accepted,
                    all the

                    following rules will be rejected.'
                orig_tags:
                  type: array
                  items:
                    type: string
                  default: []
                  description: Rule is applied only for originators with specified
                    tags.
                term_tags:
                  type: array
                  items:
                    type: string
                  default: []
                  description: Rule is applied only for terminators with specified
                    tags.
              required:
              - routing_plans_id
              - type
              - s_clients_id
              - s_accounts_id
              - routing_policies_id
              - profit_margin
              - time_profiles_id
              dependentRequired: {}
  /routing/policies:
    post:
      tags:
      - routing.policies
      operationId: routing.policies.create
      summary: Create policy
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Routing policy object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        routing.policies.create

        :::


        Routing Policy defines how appeal value is calculated for the dynamic

        routing. The value may include any combination of the rate, quality

        and/or cash flow parameters.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 64
                  description: Name.
                rate:
                  type: boolean
                  default: false
                  description: Wether to include rate into appeal value.
                asr:
                  type: boolean
                  default: false
                  description: Wether to include ASR into appeal value.
                acd:
                  type: boolean
                  default: false
                  description: Wether to include ACD into appeal value.
                pdd:
                  type: boolean
                  default: false
                  description: Wether to include PDD into appeal value.
                scd:
                  type: boolean
                  default: false
                  description: Wether to include SCD into appeal value.
                debt:
                  type: boolean
                  default: false
                  description: Wether to include vendor debt into appeal value.
                payment_due:
                  type: boolean
                  default: false
                  description: 'Wether to include days till payment due date to the

                    vendor into appeal value.'
                sort:
                  type: integer
                  minimum: -2147483647
                  maximum: 2147483647
                  default: 100
                  description: Sort order (used for options sorting in the UI).
              required:
              - name
              dependentRequired: {}
    get:
      tags:
      - routing.policies
      operationId: routing.policies.search
      summary: List policies
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of routing policy objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        routing.policies.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - id
                    - -id
                    - name
                    - -name
                    - sort
                    - -sort
                  default: []
                  description: List of columns to order results by.
                id:
                  type: integer
                  description: Routing policy ID.
              required: []
              dependentRequired: {}
  /routing/policies/{id}:
    delete:
      tags:
      - routing.policies
      operationId: routing.policies.delete
      summary: Delete policy
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Routing policy ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        routing.policies.delete

        :::


        '
    get:
      tags:
      - routing.policies
      operationId: routing.policies.get
      summary: Get policy
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Routing policy ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Routing policy object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        routing.policies.get

        :::


        '
    patch:
      tags:
      - routing.policies
      operationId: routing.policies.update
      summary: Update policy
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Routing policy ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        routing.policies.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 64
                  description: Name.
                rate:
                  type: boolean
                  default: false
                  description: Wether to include rate into appeal value.
                asr:
                  type: boolean
                  default: false
                  description: Wether to include ASR into appeal value.
                acd:
                  type: boolean
                  default: false
                  description: Wether to include ACD into appeal value.
                pdd:
                  type: boolean
                  default: false
                  description: Wether to include PDD into appeal value.
                scd:
                  type: boolean
                  default: false
                  description: Wether to include SCD into appeal value.
                debt:
                  type: boolean
                  default: false
                  description: Wether to include vendor debt into appeal value.
                payment_due:
                  type: boolean
                  default: false
                  description: 'Wether to include days till payment due date to the

                    vendor into appeal value.'
                sort:
                  type: integer
                  minimum: -2147483647
                  maximum: 2147483647
                  default: 100
                  description: Sort order (used for options sorting in the UI).
              required:
              - name
              dependentRequired: {}
  /swap_deals:
    post:
      tags:
      - swap_deals
      operationId: swap_deals.create
      summary: Create swap deal
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Swap deal object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        swap_deals.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 64
                  description: Name.
                status:
                  type: string
                  enum:
                  - active
                  - archive
                  description: Status.
                start_dt:
                  type: string
                  format: date
                  description: Start date.
                period:
                  type: string
                  format: duration
                  description: Period during which the deal will be active.
                currencies_id:
                  type: integer
                  description: Currency ID.
                grace_period:
                  type: string
                  format: duration
                  default: P0D
                  description: 'Period which is acceptable to receive leftovers of
                    traffic

                    from the partner.'
                clients_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: Client ID of the partner involved in the deal.
                accounts_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Account ID of the partner involved in the deal.

                    Either `clients_id` or `accounts_id` must be filled.'
              required:
              - name
              - status
              - start_dt
              - period
              - currencies_id
              dependentRequired: {}
    get:
      tags:
      - swap_deals
      operationId: swap_deals.search
      summary: List swap deals
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of swap deal objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        swap_deals.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - clients_name
                    - -clients_name
                    - id
                    - -id
                    - live_profit
                    - -live_profit
                    - live_status
                    - -live_status
                    - name
                    - -name
                    - start_dt
                    - -start_dt
                    - status
                    - -status
                  default: []
                  description: List of columns to order results by.
                q:
                  type: string
                  description: Quick search (wildcards allowed).
                id:
                  type: array
                  items:
                    type: integer
                  description: Swap deal ID.
                name:
                  type: string
                  description: Name.
              required: []
              dependentRequired: {}
  /swap_deals/{id}:
    delete:
      tags:
      - swap_deals
      operationId: swap_deals.delete
      summary: Delete swap deal
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Swap deal ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        swap_deals.delete

        :::


        '
    get:
      tags:
      - swap_deals
      operationId: swap_deals.get
      summary: Get swap deal
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Swap deal ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Swap deal object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        swap_deals.get

        :::


        '
    patch:
      tags:
      - swap_deals
      operationId: swap_deals.update
      summary: Update swap deal
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Swap deal ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        swap_deals.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 64
                  description: Name.
                status:
                  type: string
                  enum:
                  - active
                  - archive
                  description: Status.
                start_dt:
                  type: string
                  format: date
                  description: Start date.
                period:
                  type: string
                  format: duration
                  description: Period during which the deal will be active.
                currencies_id:
                  type: integer
                  description: Currency ID.
                grace_period:
                  type: string
                  format: duration
                  default: P0D
                  description: 'Period which is acceptable to receive leftovers of
                    traffic

                    from the partner.'
                clients_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: Client ID of the partner involved in the deal.
                accounts_id:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: 'Account ID of the partner involved in the deal.

                    Either `clients_id` or `accounts_id` must be filled.'
              required:
              - name
              - status
              - start_dt
              - period
              - currencies_id
              dependentRequired: {}
  /swap_deals/items:
    post:
      tags:
      - swap_deals.items
      operationId: swap_deals.items.create
      summary: Create item
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Swap deal item object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        swap_deals.items.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                swap_deals_id:
                  type: integer
                  description: Swap deal ID.
                direction:
                  type: string
                  enum:
                  - inbound
                  - outbound
                  description: Direction of the traffic.
                rate:
                  type: number
                  format: decimal
                  minimum: -999999999.0
                  maximum: 999999999.0
                  description: Rate for the destination under the deal.
                volume:
                  type: number
                  format: decimal
                  minimum: 0.0
                  maximum: 999999999.0
                  description: Traffic volume for the destination under the deal.
                services_id:
                  type: integer
                  description: Service ID.
                sales_rate:
                  type: number
                  format: decimal
                  minimum: -999999999.0
                  maximum: 999999999.0
                  description: 'Average rate you have in the system for this destination

                    and direction. Used to estimate the profit.'
                code:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Destination code.
                code_name:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Destination code name.

                    Either `code` or `code_name` must be filled.'
              required:
              - swap_deals_id
              - direction
              - rate
              - volume
              - services_id
              - sales_rate
              dependentRequired: {}
    get:
      tags:
      - swap_deals.items
      operationId: swap_deals.items.search
      summary: List items
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of swap deal item objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        swap_deals.items.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - code
                    - -code
                    - code_name
                    - -code_name
                    - direction
                    - -direction
                    - id
                    - -id
                  default: []
                  description: List of columns to order results by.
                id:
                  type: array
                  items:
                    type: integer
                  description: Swap deal item ID.
                swap_deals_id:
                  type: integer
                  description: Swap deal ID.
              required: []
              dependentRequired: {}
  /swap_deals/items/{id}:
    delete:
      tags:
      - swap_deals.items
      operationId: swap_deals.items.delete
      summary: Delete item
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Swap deal item ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        swap_deals.items.delete

        :::


        '
    get:
      tags:
      - swap_deals.items
      operationId: swap_deals.items.get
      summary: Get item
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Swap deal item ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Swap deal item object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        swap_deals.items.get

        :::


        '
    patch:
      tags:
      - swap_deals.items
      operationId: swap_deals.items.update
      summary: Update item
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Swap deal item ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        swap_deals.items.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                swap_deals_id:
                  type: integer
                  description: Swap deal ID.
                direction:
                  type: string
                  enum:
                  - inbound
                  - outbound
                  description: Direction of the traffic.
                rate:
                  type: number
                  format: decimal
                  minimum: -999999999.0
                  maximum: 999999999.0
                  description: Rate for the destination under the deal.
                volume:
                  type: number
                  format: decimal
                  minimum: 0.0
                  maximum: 999999999.0
                  description: Traffic volume for the destination under the deal.
                services_id:
                  type: integer
                  description: Service ID.
                sales_rate:
                  type: number
                  format: decimal
                  minimum: -999999999.0
                  maximum: 999999999.0
                  description: 'Average rate you have in the system for this destination

                    and direction. Used to estimate the profit.'
                code:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: Destination code.
                code_name:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Destination code name.

                    Either `code` or `code_name` must be filled.'
              required:
              - swap_deals_id
              - direction
              - rate
              - volume
              - services_id
              - sales_rate
              dependentRequired: {}
  /system/timezones:
    get:
      tags:
      - system
      operationId: system.get_timezones
      summary: List timezones
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Available timezones.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        system.get_timezones

        :::


        '
  /system/audit_log/{id}:
    get:
      tags:
      - system.audit_log
      operationId: system.audit_log.get
      summary: Get log entry
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Audit log entry ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Audit log entry object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        system.audit_log.get

        :::


        '
  /system/audit_log:
    get:
      tags:
      - system.audit_log
      operationId: system.audit_log.search
      summary: List log entries
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of audit log entry objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        system.audit_log.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - dt
                    - -dt
                  default: []
                  description: List of columns to order results by.
                object_id:
                  type: integer
                  description: Object ID.
                object_name:
                  type: string
                  description: Object name (wildcards allowed).
                object_type:
                  type: array
                  items:
                    type: string
                    enum:
                    - clients
                    - clients.accounts
                    - companies
                    - dids
                    - clients.templates
                    - accounting.payments
                  description: Type of the object.
                method:
                  type: array
                  items:
                    type: string
                  description: Applied method.
                dt:
                  type: array
                  minItems: 2
                  maxItems: 2
                  items:
                    type: string
                    format: date-time
                  example:
                  - '2025-06-10T10:00:00.000Z'
                  - '2025-07-02T16:00:00.000Z'
                  description: Log entry timestamp.
                users_id:
                  type: integer
                  description: User ID who made a change.
                users_login:
                  type: string
                  description: User login who made a change.
                system_services_id:
                  type: string
                  description: System service ID which made a change.
              required: []
              dependentRequired: {}
  /system/collectors/{id}:
    get:
      tags:
      - system.collectors
      operationId: system.collectors.get
      summary: Get collector
      parameters:
      - in: path
        name: id
        schema:
          type: string
        required: true
        description: Collector ID.
      - in: query
        name: type
        schema:
          type: string
          enum:
          - radius
          - flnp
          - fxdrs
          - ac
          - sip
          - lnp
          default: null
          nullable: true
        description: If specified, only return collector if the type matches.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Collector details object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        system.collectors.get

        :::


        '
  /system/collectors:
    get:
      tags:
      - system.collectors
      operationId: system.collectors.search
      summary: List collectors
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of collector objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        system.collectors.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - id
                    - -id
                    - name
                    - -name
                  default: []
                  description: List of columns to order results by.
                id:
                  type: array
                  items:
                    type: string
                    minLength: 1
                    maxLength: 64
                  description: Collector ID.
                type:
                  type: string
                  enum:
                  - radius
                  - flnp
                  - fxdrs
                  - ac
                  - sip
                  - lnp
                  description: Type.
              required: []
              dependentRequired: {}
  /system/database/sessions:
    get:
      tags:
      - system.database
      operationId: system.database.get_sessions
      summary: List sessions
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of database session objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        system.database.get_sessions

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - application_name
                    - -application_name
                    - backend_duration
                    - -backend_duration
                    - backend_start
                    - -backend_start
                    - client_addr
                    - -client_addr
                    - pid
                    - -pid
                    - query_duration
                    - -query_duration
                    - query_start
                    - -query_start
                    - state
                    - -state
                    - state_full
                    - -state_full
                    - state_priority
                    - -state_priority
                    - wait_event_type
                    - -wait_event_type
                    - xact_duration
                    - -xact_duration
                    - xact_start
                    - -xact_start
                  default: []
                  description: List of columns to order results by.
                pid:
                  type:
                  - integer
                  - 'null'
                  default: null
                  description: System process ID.
              required: []
              dependentRequired: {}
  /system/events/{id}:
    get:
      tags:
      - system.events
      operationId: system.events.get
      summary: Get log entry
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Event ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Events log entry object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        system.events.get

        :::


        '
  /system/events:
    get:
      tags:
      - system.events
      operationId: system.events.search
      summary: List log entries
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of event log entry objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        system.events.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - dt
                    - -dt
                    - id
                    - -id
                    - message
                    - -message
                    - nodes_id
                    - -nodes_id
                    - sender
                    - -sender
                    - type
                    - -type
                  default: []
                  description: List of columns to order results by.
                q:
                  type: string
                  description: Quick search (wildcards allowed).
                id:
                  type: integer
                  description: Event ID.
                sender:
                  type: array
                  items:
                    type: string
                    maxLength: 32
                  description: Sender service.
                nodes_id:
                  type: array
                  items:
                    type: string
                  description: Cluster node ID.
                type:
                  type: array
                  items:
                    type: string
                    enum:
                    - error
                    - message
                    - alert
                  description: Type.
                dt:
                  type: array
                  minItems: 2
                  maxItems: 2
                  items:
                    type: string
                    format: date-time
                  example:
                  - '2025-06-10T10:00:00.000Z'
                  - '2025-07-02T16:00:00.000Z'
                  description: Timestamp.
                tags:
                  type: array
                  description: Associated event tags.
                message_match:
                  type: string
                  format: regex
                  description: Match message using regular expression.
              required: []
              dependentRequired: {}
  /system/events/config:
    post:
      tags:
      - system.events.config
      operationId: system.events.config.create
      summary: Create watch rule
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Events log watch rule object as has been stored.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        system.events.config.create

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  description: Title. The value will be added to the message subject.
                emails:
                  type: array
                  items:
                    type: string
                    format: email
                  description: Email(s) to which notification will be sent.
                group_limit:
                  type: integer
                  minimum: 0
                  maximum: 65535
                  description: 'Maximum number of messages to be sent separately.

                    If more than this number of messages are found, they will be

                    aggregated into a single email. Set to `0` to always aggregate

                    all matching messages into single email.'
                group_details_limit:
                  type: integer
                  minimum: 0
                  maximum: 65535
                  description: 'Maximum length of details to send within

                    notification for each matching item. For aggregated messages only.'
                sender:
                  type:
                  - array
                  - 'null'
                  items:
                    type: string
                    maxLength: 32
                  default: null
                  description: System service(s) to match.
                type:
                  type:
                  - array
                  - 'null'
                  items:
                    type: string
                    enum:
                    - error
                    - message
                    - alert
                  default: null
                  description: Type(s) of events to match.
                tags:
                  type:
                  - array
                  - 'null'
                  default: null
                  description: Tag(s) to match, uses "match any" logic.
                message_match:
                  type:
                  - string
                  - 'null'
                  format: regex
                  default: null
                  description: Match message using regular expression.
              required:
              - title
              - emails
              - group_limit
              - group_details_limit
              dependentRequired: {}
    get:
      tags:
      - system.events.config
      operationId: system.events.config.search
      summary: List watch rules
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of event log watch rule objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        system.events.config.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - emails
                    - -emails
                    - id
                    - -id
                    - title
                    - -title
                  default: []
                  description: List of columns to order results by.
                id:
                  type: integer
                  description: Event log watch rule ID.
              required: []
              dependentRequired: {}
  /system/events/config/{id}:
    delete:
      tags:
      - system.events.config
      operationId: system.events.config.delete
      summary: Delete watch rule
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Event log watch rule ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        system.events.config.delete

        :::


        '
    get:
      tags:
      - system.events.config
      operationId: system.events.config.get
      summary: Get watch rule
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Event log watch rule ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Event log watch rule object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        system.events.config.get

        :::


        '
    patch:
      tags:
      - system.events.config
      operationId: system.events.config.update
      summary: Update watch rule
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Event log watch rule ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        system.events.config.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  description: Title. The value will be added to the message subject.
                emails:
                  type: array
                  items:
                    type: string
                    format: email
                  description: Email(s) to which notification will be sent.
                group_limit:
                  type: integer
                  minimum: 0
                  maximum: 65535
                  description: 'Maximum number of messages to be sent separately.

                    If more than this number of messages are found, they will be

                    aggregated into a single email. Set to `0` to always aggregate

                    all matching messages into single email.'
                group_details_limit:
                  type: integer
                  minimum: 0
                  maximum: 65535
                  description: 'Maximum length of details to send within

                    notification for each matching item. For aggregated messages only.'
                sender:
                  type:
                  - array
                  - 'null'
                  items:
                    type: string
                    maxLength: 32
                  default: null
                  description: System service(s) to match.
                type:
                  type:
                  - array
                  - 'null'
                  items:
                    type: string
                    enum:
                    - error
                    - message
                    - alert
                  default: null
                  description: Type(s) of events to match.
                tags:
                  type:
                  - array
                  - 'null'
                  default: null
                  description: Tag(s) to match, uses "match any" logic.
                message_match:
                  type:
                  - string
                  - 'null'
                  format: regex
                  default: null
                  description: Match message using regular expression.
              required:
              - title
              - emails
              - group_limit
              - group_details_limit
              dependentRequired: {}
  /system/events/tags:
    get:
      tags:
      - system.events.tags
      operationId: system.events.tags.search
      summary: List tags
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of available tags.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
      description: ':::note[JSON-RPC]

        system.events.tags.search

        :::


        '
  /system/files/{id}:
    delete:
      tags:
      - system.files
      operationId: system.files.delete
      summary: Delete file
      parameters:
      - in: path
        name: id
        schema:
          type: string
        required: true
        description: File ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        system.files.delete

        :::


        '
    get:
      tags:
      - system.files
      operationId: system.files.get
      summary: Get file details
      parameters:
      - in: path
        name: id
        schema:
          type: string
        required: true
        description: File ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: File details object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        system.files.get

        :::


        '
  /system/license_info:
    get:
      tags:
      - system.license_info
      operationId: system.license_info.get
      summary: Get license details
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: License details.
          content:
            application/json:
              schema:
                type: object
      description: ":::note[JSON-RPC]\nsystem.license_info.get\n:::\n\nMethod returns\
        \ general information about license:\n    * License code\n    * License expiry\
        \ date\n    * Included components\n    * Entitled limits and their usage"
  /system/nodes/replication-status:
    get:
      tags:
      - system.nodes
      operationId: system.nodes.replication_status
      summary: Get replication status
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Replication status for all nodes as seen from the current node.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        system.nodes.replication_status

        :::


        Method returns replication status as seen from current node. If executed

        on the Master - it will give the most wide overview. If executed on any

        of the Slaves it will give list of all nodes and delay to the Master.'
  /system/nodes:
    get:
      tags:
      - system.nodes
      operationId: system.nodes.search
      summary: List nodes
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of node objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        system.nodes.search

        :::


        The method returns list of the nodes in the cluster, including their

        status, last ping, configuration and load details.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: array
                  items:
                    type: string
                  description: Cluster node ID.
                ip_address:
                  type: array
                  items:
                    type: string
                    format: ipv4
                  description: IP address (by which node is registered in the cluster).
                active:
                  type: boolean
                  description: If `True`, only active nodes will be returned.
                role:
                  type: array
                  items:
                    type: string
                    enum:
                    - master
                    - redundancy
                    - reporting
                    - processing
                    - failed
                  description: Role in the cluster.
                role_ne:
                  type: string
                  enum:
                  - master
                  - redundancy
                  - reporting
                  - processing
                  - failed
                  description: Exclude nodes with given role.
              required: []
              dependentRequired: {}
  /system/notifications/{id}/dismiss:
    post:
      tags:
      - system.notifications
      operationId: system.notifications.dismiss
      summary: Dismiss notification
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Notification ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        system.notifications.dismiss

        :::


        '
  /system/notifications/{id}:
    get:
      tags:
      - system.notifications
      operationId: system.notifications.get
      summary: Get notification
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Notification ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Notification object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        system.notifications.get

        :::


        '
  /system/notifications:
    get:
      tags:
      - system.notifications
      operationId: system.notifications.search
      summary: List notifications
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of notification objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        system.notifications.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: Number of rows to return (for pagination).
                  default: 20
                offset:
                  type: integer
                  description: Number of rows to skip (for pagination).
                  default: 0
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - code
                    - -code
                    - code_group
                    - -code_group
                    - created_dt
                    - -created_dt
                    - level
                    - -level
                    - nodes_id
                    - -nodes_id
                  default: []
                  description: List of columns to order results by.
                id:
                  type: array
                  items:
                    type: integer
                  description: Notification ID.
                nodes_id:
                  type: array
                  items:
                    type: string
                  description: Cluster node ID. For notifications related to a specific
                    node.
                code_group:
                  type: array
                  items:
                    type: string
                  description: Notification code group.
                code:
                  type: array
                  items:
                    type: string
                  description: Notification code.
                level:
                  type: array
                  items:
                    type: string
                  description: Notification level.
                skip_expired:
                  type: boolean
                  default: true
                  description: 'If `True`, expired notifications will be excluded
                    from

                    the result.'
                skip_dismissed:
                  type: boolean
                  default: true
                  description: 'If `True`, notifications dismissed by the current
                    API

                    user will be excluded from the result.'
              required: []
              dependentRequired: {}
  /system/services/{id}:
    get:
      tags:
      - system.services
      operationId: system.services.get
      summary: Get service
      parameters:
      - in: path
        name: id
        schema:
          type: string
        required: true
        description: System service ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Service object.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        system.services.get

        :::


        '
    patch:
      tags:
      - system.services
      operationId: system.services.update
      summary: Update service
      parameters:
      - in: path
        name: id
        schema:
          type: string
        required: true
        description: System service ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        system.services.update

        :::


        :::info

        All parameters except `id` are optional, only provided parameters will be

        updated.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                status:
                  type: string
                  enum:
                  - enabled
                  - disabled
                  description: Status.
                schedule_type:
                  type: string
                  enum:
                  - fixed
                  - daemon
                  - periodic
                  description: 'Schedule type:

                    * `periodic` - run at fixed intervals.

                    * `fixed` - run at fixed times.

                    * `daemon` - run as a daemon.'
                schedule_period:
                  type: integer
                  minimum: 1
                  maximum: 60
                  description: 'Run interval in minutes. Required if `schedule_type`

                    is `periodic`.'
                schedule_period_align:
                  type: integer
                  minimum: 0
                  maximum: 59
                  description: 'Run align in minutes. Required to balance

                    services that are run at same intervals. If align is set to 3
                    and

                    period is set to 10, service will run at XX:03, XX:13 and so on.

                    Required if `schedule_type` is `periodic`.'
                groups:
                  type:
                  - array
                  - 'null'
                  items:
                    type: string
                  default: null
                  description: 'List of system groups to isolate run of the services
                    of

                    the same group at the same time. For internal usage only.'
                schedule_fixed:
                  type:
                  - array
                  - 'null'
                  items:
                    type: string
                    format: time
                  default: null
                  description: 'List of times to run the service. Required if

                    `schedule_type` is `fixed`.'
              required:
              - status
              - schedule_type
              - schedule_period
              - schedule_period_align
              dependentRequired: {}
  /system/services/{id}/run:
    post:
      tags:
      - system.services
      operationId: system.services.run
      summary: Run service
      parameters:
      - in: path
        name: id
        schema:
          type: string
        required: true
        description: System service ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        system.services.run

        :::


        The method sets *queue_run* flag on the service. It will be processed by

        the *Tasks Scheduler* on the next run (within 1 minute).'
  /system/services/{id}/reset-run:
    post:
      tags:
      - system.services
      operationId: system.services.run_reset
      summary: Reset run flag
      parameters:
      - in: path
        name: id
        schema:
          type: string
        required: true
        description: System service ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        system.services.run_reset

        :::


        The method resets *queue_run* flag previously set on the service.'
  /system/services:
    get:
      tags:
      - system.services
      operationId: system.services.search
      summary: List services
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of system service objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        system.services.search

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                order:
                  type: array
                  items:
                    type: string
                    enum:
                    - id
                    - -id
                    - schedule_type
                    - -schedule_type
                  default: id
                  description: List of columns to order results by.
                id:
                  type: array
                  items:
                    type: string
                  description: System service ID.
                status:
                  type: string
                  enum:
                  - enabled
                  - disabled
                  description: Status.
                internal:
                  type: boolean
                  description: 'If `True`, only internal services will be returned.
                    Internal

                    services are not typically visible in the UI and enable overall

                    functionality of the system.'
              required: []
              dependentRequired: {}
  /system/services/active/{system_services_id}/status:
    get:
      tags:
      - system.services.active
      operationId: system.services.active.check_status
      summary: Get service status
      parameters:
      - in: path
        name: system_services_id
        schema:
          type: string
        required: true
        description: System service ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: 'Object containing service details if it is alive, otherwise
            ``None`` is

            returned.'
          content:
            application/json:
              schema:
                type:
                - object
                - 'null'
      description: ":::note[JSON-RPC]\nsystem.services.active.check_status\n:::\n\n\
        The method checks if service is active using 3 steps:\n    1. The method is\
        \ registered in the active services registry.\n    2. The PID-file is present.\n\
        \    3. The process with recorded PID is alive.\n\nAdditionally, the method\
        \ removes leftovers (pid-file and registration in\nactive services), which\
        \ may occur if services has been terminated by\n`SIGKILL` or finished abnormally.\n\
        \n:::warning\nThe method checks only services on the node, where it is called.\n\
        :::\n\n:::note\nIf the service has been executed incorrectly, it is possible\
        \ that PID-file\nis present, but service is not registered in the active services.\
        \ In this\ncase the method will return only `pid` key in the response.\n:::"
  /system/services/active/{system_services_id}/reload:
    post:
      tags:
      - system.services.active
      operationId: system.services.active.mark_reload
      summary: Set reload flag
      parameters:
      - in: path
        name: system_services_id
        schema:
          type: string
        required: true
        description: System service ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        system.services.active.mark_reload

        :::


        The method sets *reload* flag on the service. It will be processed by

        the *"Tasks Scheduler"* system service within the next run (typically

        within 1 minute). As a result `SIGHUP` signal will be sent to the process.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                nodes_id:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Cluster node ID to which operation should be applied.

                    If not given, all nodes will be processed.'
              required: []
              dependentRequired: {}
  /system/services/active/{system_services_id}/terminate:
    post:
      tags:
      - system.services.active
      operationId: system.services.active.mark_terminate
      summary: Set termination flag
      parameters:
      - in: path
        name: system_services_id
        schema:
          type: string
        required: true
        description: System service ID.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Number of the affected rows.
          content:
            application/json:
              schema:
                type: integer
      description: ':::note[JSON-RPC]

        system.services.active.mark_terminate

        :::


        The method sets *terminate* flag on the service. It will be processed by

        the *"Tasks Scheduler"* system service within the next run (typically

        within 1 minute). As a result `SIGTERM` signal will be sent to the process.


        :::note

        In the abnormal situation, where the process hanged and became a zombie,

        the signal may be not processed. In this case service may be terminated

        only via shell.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                nodes_id:
                  type:
                  - string
                  - 'null'
                  default: null
                  description: 'Cluster node ID to which operation should be applied.

                    If not given, all nodes will be processed.'
              required: []
              dependentRequired: {}
  /system/services/active:
    get:
      tags:
      - system.services.active
      operationId: system.services.active.search
      summary: List services
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: List of active system service objects.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      description: ':::note[JSON-RPC]

        system.services.active.search

        :::


        Function returns list of the currently active system services within the

        cluster.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                nodes_id:
                  type: array
                  items:
                    type: string
                  description: Node ID.
                system_services_id:
                  type: array
                  items:
                    type: string
                  description: System service ID.
                internal:
                  type: boolean
                  default: false
                  description: 'If `True`, only internal services will be returned.
                    Internal

                    services are not typically visible in the UI and enable overall

                    functionality of the system.'
              required: []
              dependentRequired: {}
  /system/settings:
    get:
      tags:
      - system.settings
      operationId: system.settings.get
      summary: Get parameter
      parameters:
      - in: query
        name: name
        schema:
          type: string
        required: true
        description: Parameter name.
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Parameter value.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        system.settings.get

        :::


        :::note

        The method caches results for 5 minutes.

        :::'
    patch:
      tags:
      - system.settings
      operationId: system.settings.update
      summary: Update parameter
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: '`True` if setting has been updated. `False` if new value is
            equal to

            the old one.'
          content:
            application/json:
              schema:
                type: boolean
      description: ':::note[JSON-RPC]

        system.settings.update

        :::


        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  enum:
                  - system.url
                  - system.collect_usage_data
                  - system.security_checks
                  - system.jeraping
                  - system.timezone
                  - system.locale
                  - system.dateym_format
                  - system.date_format
                  - system.datetime_format
                  - system.datetimetz_format
                  - system.virtual_ip
                  - system.password_policy.enforce_strong
                  - system.jwt.algorithm
                  - system.jwt.key
                  - system.jwt.expiry
                  - system.libxl.name
                  - system.libxl.code
                  - system.lnp.public_ip
                  - system.csv.delimiter_columns
                  - system.csv.delimiter_decimal
                  - system.temp.itemsPerPage
                  - system.temp.seen_version
                  - system.temp.seen_support
                  - system.temp.xdr_round_monetary
                  - system.temp.import_encoding
                  - system.temp.export_encoding
                  - core.currencies_id
                  - core.notify_unknown_account
                  - core.notify_unknown_rate
                  - core.notify_zero_volume
                  - core.events_cache_expiry
                  - clients.bill_by_time
                  - clients.accounts.password_policy.required
                  - rates.codes.range_size_max
                  - bbradiusd.bind
                  - bbradiusd.port_acct
                  - bbradiusd.port_auth
                  - bbradiusd.workers
                  - bbradiusd.max_routes_qty
                  - bbradiusd.udp_buffer
                  - bbradiusd.max_call_length
                  - bbsipd.bind
                  - bbsipd.port
                  - bbsipd.udp_buffer
                  - bbsipd.workers
                  - bbsipd.max_routes_qty
                  - mail_manager.smtp_credentials_id
                  - mail_manager.from
                  - rates_generator.workers
                  - rates_generator.delay
                  - backup_manager.period
                  - backup_manager.include
                  - backup_manager.dst_path
                  - backup_manager.keep_packages
                  - backup_manager.last_dt
                  - backup_manager.workers
                  - backup_manager.disk_usage_threshold
                  - dr_manager.stats_analyze_period
                  - dr_manager.stats_min_qty
                  - dr_manager.default_asr
                  - dr_manager.default_acd
                  - dr_manager.default_pdd
                  - dr_manager.default_scd
                  - dr_manager.last_generation_ts
                  - invoicing.no_last
                  - invoicing.auto_generation_delay
                  - invoicing.auto_generation_state
                  - invoicing.allow_zero
                  - invoicing.check_code_names
                  - invoicing.hide_numbers_length
                  - calculator.order
                  - calculator.rerating_mode
                  - calculator.workers
                  - calculator.workers.buffer
                  - calculator.node_replication_delay
                  - summary.execution_time_limit
                  - statspkg_manager.rotate_delay
                  - statspkg_manager.archive_delay
                  - statspkg_manager.ignore_load
                  - statspkg_manager.acquire_lock_timeout
                  - cleaner.delay.logs
                  - cleaner.delay.events
                  - cleaner.delay.rates
                  - cleaner.delay.xdrs
                  - cleaner.delay.mail_queue
                  - cleaner.delay.imports
                  - importd.analysis.workers
                  - importd.storage.workers
                  - importd.storage.chunk_size
                  - files_collector.queue
                  - files_collector.workers
                  - files_collector.workers.buffer_len
                  - ac_manager.workers
                  - ac_manager.reload_interval
                  - rates_notificator.notify_period
                  - reports_generator.origterm.cross_gateway
                  - reports_toemail.workers
                  - reports_monitoring.workers
                  - log_rotator.policies
                  - log_rotator.rules
                  - log_rotator.default
                  - events_manager.last_dt
                  - aaa_manager.sessions_cleanup_delay
                  - aaa_manager.routing_cleanup_delay
                  - filename.invoices.main
                  - filename.invoices.xdr
                  - filename.invoices.peppol
                  - filename.rates.export
                  - filename.rates.notifications.all
                  - filename.rates.notifications.unique
                  - filename.rates.notifications.changed
                  - filename.reports
                  - filename.reports_toemail
                  description: Setting name.
                value:
                  oneOf:
                  - type: string
                    format: uri
                    title: system.url
                  - type: boolean
                    title: system.collect_usage_data
                  - type: boolean
                    title: system.security_checks
                  - type:
                    - object
                    - 'null'
                    title: system.jeraping
                  - type: string
                    format: timezone
                    title: system.timezone
                  - type: string
                    minLength: 2
                    maxLength: 2
                    title: system.locale
                  - type: string
                    title: system.dateym_format
                  - type: string
                    title: system.date_format
                  - type: string
                    title: system.datetime_format
                  - type: string
                    title: system.datetimetz_format
                  - type: string
                    format: ipv4
                    title: system.virtual_ip
                  - type: boolean
                    title: system.password_policy.enforce_strong
                  - type: string
                    enum:
                    - HS256
                    - HS384
                    - HS512
                    title: system.jwt.algorithm
                  - type: string
                    minLength: 32
                    title: system.jwt.key
                  - type: integer
                    minimum: 1
                    maximum: 31536000
                    title: system.jwt.expiry
                  - type: string
                    title: system.libxl.name
                  - type: string
                    title: system.libxl.code
                  - type: string
                    format: ipv4
                    title: system.lnp.public_ip
                  - type: string
                    minLength: 1
                    maxLength: 1
                    title: system.csv.delimiter_columns
                  - type: string
                    minLength: 0
                    maxLength: 1
                    title: system.csv.delimiter_decimal
                  - type: integer
                    minimum: 5
                    maximum: 500
                    title: system.temp.itemsPerPage
                  - type: string
                    title: system.temp.seen_version
                  - type: integer
                    title: system.temp.seen_support
                  - type: boolean
                    title: system.temp.xdr_round_monetary
                  - type: string
                    enum:
                    - utf-8
                    - windows-1251
                    title: system.temp.import_encoding
                  - type: string
                    enum:
                    - utf-8
                    - windows-1251
                    title: system.temp.export_encoding
                  - type: integer
                    title: core.currencies_id
                  - type: boolean
                    title: core.notify_unknown_account
                  - type: boolean
                    title: core.notify_unknown_rate
                  - type: boolean
                    title: core.notify_zero_volume
                  - type: integer
                    minimum: 1
                    maximum: 86400
                    title: core.events_cache_expiry
                  - type: string
                    enum:
                    - setup
                    - connect
                    - disconnect
                    title: clients.bill_by_time
                  - type: boolean
                    title: clients.accounts.password_policy.required
                  - type: integer
                    title: rates.codes.range_size_max
                  - type: string
                    format: ipv4
                    title: bbradiusd.bind
                  - type: integer
                    minimum: 128
                    maximum: 65535
                    title: bbradiusd.port_acct
                  - type: integer
                    minimum: 128
                    maximum: 65535
                    title: bbradiusd.port_auth
                  - type: integer
                    minimum: 1
                    maximum: 64
                    title: bbradiusd.workers
                  - type: integer
                    minimum: 1
                    maximum: 64
                    title: bbradiusd.max_routes_qty
                  - type: integer
                    minimum: 16384
                    maximum: 104857600
                    title: bbradiusd.udp_buffer
                  - type: integer
                    minimum: 0
                    title: bbradiusd.max_call_length
                  - type: string
                    format: ipv4
                    title: bbsipd.bind
                  - type: integer
                    minimum: 128
                    maximum: 65535
                    title: bbsipd.port
                  - type: integer
                    minimum: 16384
                    maximum: 104857600
                    title: bbsipd.udp_buffer
                  - type: integer
                    minimum: 1
                    maximum: 64
                    title: bbsipd.workers
                  - type: integer
                    minimum: 1
                    maximum: 64
                    title: bbsipd.max_routes_qty
                  - type: integer
                    title: mail_manager.smtp_credentials_id
                  - type: string
                    title: mail_manager.from
                  - type: integer
                    minimum: 1
                    maximum: 64
                    title: rates_generator.workers
                  - type: integer
                    minimum: 0
                    title: rates_generator.delay
                  - type: integer
                    minimum: 0
                    title: backup_manager.period
                  - type: array
                    items:
                      type: string
                      enum:
                      - database
                      - files-app
                      - files-data
                    title: backup_manager.include
                  - type: string
                    format: path
                    title: backup_manager.dst_path
                  - type: integer
                    minimum: 1
                    title: backup_manager.keep_packages
                  - type: string
                    format: date-time
                    title: backup_manager.last_dt
                  - type: integer
                    minimum: 1
                    maximum: 64
                    title: backup_manager.workers
                  - type: integer
                    minimum: 0
                    maximum: 100
                    title: backup_manager.disk_usage_threshold
                  - type: integer
                    minimum: 1
                    maximum: 1440
                    title: dr_manager.stats_analyze_period
                  - type: integer
                    minimum: 1
                    title: dr_manager.stats_min_qty
                  - type: number
                    format: decimal
                    minimum: 0.1
                    maximum: 100.0
                    title: dr_manager.default_asr
                  - type: number
                    format: decimal
                    minimum: 0.1
                    title: dr_manager.default_acd
                  - type: number
                    format: decimal
                    minimum: 0.1
                    title: dr_manager.default_pdd
                  - type: number
                    format: decimal
                    minimum: 0.1
                    title: dr_manager.default_scd
                  - type: number
                    format: decimal
                    minimum: 0.0
                    title: dr_manager.last_generation_ts
                  - type: integer
                    minimum: 1
                    title: invoicing.no_last
                  - type: integer
                    minimum: 0
                    title: invoicing.auto_generation_delay
                  - type: string
                    enum:
                    - ok
                    - to_send
                    - to_verify
                    title: invoicing.auto_generation_state
                  - type: boolean
                    title: invoicing.allow_zero
                  - type: boolean
                    title: invoicing.check_code_names
                  - type: integer
                    minimum: 0
                    maximum: 5
                    title: invoicing.hide_numbers_length
                  - type: string
                    enum:
                    - asc
                    - desc
                    title: calculator.order
                  - type: string
                    enum:
                    - regular
                    - historic
                    title: calculator.rerating_mode
                  - type: integer
                    minimum: 1
                    maximum: 64
                    title: calculator.workers
                  - type: integer
                    minimum: 1
                    title: calculator.workers.buffer
                  - type: integer
                    minimum: 0
                    title: calculator.node_replication_delay
                  - type: integer
                    minimum: 0
                    title: summary.execution_time_limit
                  - type: integer
                    minimum: 0
                    title: statspkg_manager.rotate_delay
                  - type: integer
                    minimum: 0
                    title: statspkg_manager.archive_delay
                  - type: boolean
                    title: statspkg_manager.ignore_load
                  - type: integer
                    minimum: 0
                    title: statspkg_manager.acquire_lock_timeout
                  - type: integer
                    minimum: 0
                    title: cleaner.delay.logs
                  - type: integer
                    minimum: 1
                    maximum: 90
                    title: cleaner.delay.events
                  - type: integer
                    minimum: 0
                    title: cleaner.delay.rates
                  - type: integer
                    minimum: 0
                    title: cleaner.delay.xdrs
                  - type: integer
                    minimum: 0
                    title: cleaner.delay.mail_queue
                  - type: integer
                    minimum: 1
                    title: cleaner.delay.imports
                  - type: integer
                    minimum: 1
                    maximum: 64
                    title: importd.analysis.workers
                  - type: integer
                    minimum: 1
                    maximum: 64
                    title: importd.storage.workers
                  - type: integer
                    minimum: 1
                    title: importd.storage.chunk_size
                  - type: integer
                    minimum: 1
                    title: files_collector.queue
                  - type: integer
                    minimum: 1
                    maximum: 64
                    title: files_collector.workers
                  - type: integer
                    minimum: 1
                    title: files_collector.workers.buffer_len
                  - type: integer
                    minimum: 1
                    title: ac_manager.workers
                  - type: integer
                    minimum: 1
                    title: ac_manager.reload_interval
                  - type: integer
                    minimum: 0
                    title: rates_notificator.notify_period
                  - type: boolean
                    title: reports_generator.origterm.cross_gateway
                  - type: integer
                    minimum: 1
                    maximum: 64
                    title: reports_toemail.workers
                  - type: integer
                    minimum: 1
                    maximum: 64
                    title: reports_monitoring.workers
                  - type: object
                    title: log_rotator.policies
                  - type: object
                    title: log_rotator.rules
                  - type: string
                    title: log_rotator.default
                  - type: string
                    format: date-time
                    title: events_manager.last_dt
                  - type: integer
                    minimum: 1
                    title: aaa_manager.sessions_cleanup_delay
                  - type: integer
                    minimum: 1
                    title: aaa_manager.routing_cleanup_delay
                  - type: string
                    maxLength: 256
                    title: filename.invoices.main
                  - type: string
                    maxLength: 256
                    title: filename.invoices.xdr
                  - type: string
                    maxLength: 256
                    title: filename.invoices.peppol
                  - type: string
                    maxLength: 256
                    title: filename.rates.export
                  - type: string
                    maxLength: 256
                    title: filename.rates.notifications.all
                  - type: string
                    maxLength: 256
                    title: filename.rates.notifications.unique
                  - type: string
                    maxLength: 256
                    title: filename.rates.notifications.changed
                  - type: string
                    maxLength: 256
                    title: filename.reports
                  - type: string
                    maxLength: 256
                    title: filename.reports_toemail
                  description: Setting value.
              required:
              - name
              dependentRequired: {}
  /system/settings/multi:
    get:
      tags:
      - system.settings
      operationId: system.settings.get_multi
      summary: Get multiple parameters
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Object containing settings as key/value pairs.
          content:
            application/json:
              schema:
                type: object
      description: ':::note[JSON-RPC]

        system.settings.get_multi

        :::


        :::note

        The method caches results for 5 minutes.

        :::'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                names:
                  type: array
                  items:
                    type: string
                  description: Parameter names to get.
              required:
              - names
              dependentRequired: {}
  /system/statistics/meta-by-days:
    get:
      tags:
      - system.statistics
      operationId: system.statistics.get_meta_by_days
      summary: Get meta by days
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Object containing meta info (with keys as `YYYYMMDD`).
          content:
            application/json:
              schema:
                type: object
      description: ":::note[JSON-RPC]\nsystem.statistics.get_meta_by_days\n:::\n\n\
        The method returns meta information about the statistic packages grouped\n\
        by days.\n\n* **General daily package information**\n    * `table_prefix`\
        \ - table prefix\n    * `date` - respective date in UTC timezone\n    * `version`\
        \ - version of the package\n    * `is_actual` - flag indicating if the package\
        \ is up to date\n    * `is_mounted` - flag indicating if the package is mounted\
        \ to statistics\n    * `is_archived` - flag indicating if the package is already\
        \ archived\n    * `last_xdrs_append` - last date of xDRs creation in the package\n\
        \    * `last_update` - last modification of the package (including\n     \
        \   append of new xDRs, rating or rerating)\n    * `last_archive` - last archive\
        \ date of the package\n    * `action` - current action set on package\n\n\
        * **Usage data grouped by quantities**\n    * `all` - all xDRs\n    * `paid`\
        \ - paid xDRs (charged directly or by package)\n    * `new` - new xDRs queue\n\
        \    * `rerating` - rerating xDRs queue"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                date_range:
                  type:
                  - array
                  - 'null'
                  minItems: 2
                  maxItems: 2
                  items:
                    type:
                    - string
                    - 'null'
                    format: date
                    default: null
                  example:
                  - '2025-06-10'
                  - '2025-07-02'
                  default: null
                  description: Date range to return meta for.
              required: []
              dependentRequired: {}
  /system/statistics/meta-by-months:
    get:
      tags:
      - system.statistics
      operationId: system.statistics.get_meta_by_months
      summary: Get meta by months
      parameters: []
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ObjectNotFound'
        '422':
          $ref: '#/components/responses/LogicalError'
        '500':
          $ref: '#/components/responses/InternalError'
        '200':
          description: Object containing meta info (with keys as ``YYYYMM``).
          content:
            application/json:
              schema:
                type: object
      description: ":::note[JSON-RPC]\nsystem.statistics.get_meta_by_months\n:::\n\
        \nThe method returns meta information about the statistic packages grouped\n\
        by months.\n\n* **General monthly package information**\n    * `ym` - year\
        \ and month of the package\n    * `days` - quantity of daily packages\n  \
        \  * `is_actual` - flag indicating if all packages are up to date\n    * `is_mounted`\
        \ - flag indicating if the package is mounted to statistics\n    * `is_archived`\
        \ - flag indicating if all packages are already archived\n    * `notifications`\
        \ - license usage notifications\n\n* **Usage data grouped by quantities**\n\
        \    * `all` - all xDRs\n    * `paid` - paid xDRs (charged directly or by\
        \ package)\n    * `new` - new xDRs queue\n    * `rerating` - rerating xDRs\
        \ queue\n    * `license` - xDRs that have license limits\n\n* **License usage\
        \ notifications**\n    * `limit-monthly-hard` - license limit has been reached;\n\
        \    * `limit-monthly-soft` - license limit has been used for 85% or more;\n\
        \    * `limit-monthly-est` - indicates that if the usage will continue\n \
        \       with the same pace, the license limit may be reached by the end\n\
        \        of the month."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                months:
                  type:
                  - array
                  - 'null'
                  items:
                    type: string
                    minLength: 6
                    maxLength: 6
                  default: null
                  description: 'List of months in `YYYYMM` format to include. If not
                    given,

                    all available packages will be returned.'
                with_queue:
                  type:
                  - boolean
                  - 'null'
                  default: null
                  description: 'If `True`, only packages with calculation queue (new
                    or

                    rerating) will be returned.'
              required: []
              dependentRequired: {}
