# Beta API v3

{% hint style="danger" %}
This API is private and not publicly accessible. Any requests made without proper authorization and credentials will be rejected. Usage is restricted to approved B2B partners only.
{% endhint %}

Coinrule's B2B API allows authorized business partners to programmatically create and manage automated trading rules on behalf of their users. Using this API, a business can define complex trading strategies – such as periodic purchases (DCA), conditional trades based on market signals, etc. – and execute them on a user's account/wallet. The API is RESTful, uses JSON for request and response bodies, and all requests must be made over HTTPS to the Coinrule API endpoint.

**Base URL:** `https://api.coinrule.com/v3` (All endpoints described here are relative to this base URL).

Some key features of the Coinrule B2B API:

* **Automation of Trades:** Define rules consisting of conditions (market triggers, time schedules, etc.) and actions (trades or notifications). The Coinrule engine will monitor conditions and execute trades when conditions are met.
* **Flexible Rule Logic:** Support for various condition types (price thresholds, coin performance comparisons, external signals, etc.), logical operators (and/or sequences, waiting periods, exclusions), and action types (buy/sell trades on supported exchanges, notifications via email/Telegram).
* **Scheduled and Real-time Execution:** Rules can be triggered on a schedule (e.g. every hour/day or at a specific time) or by real-time market events or external signals.
* **Comprehensive Response Data:** When trades are executed, detailed information about each trade is available (status, quantities, prices, fees, etc.), as defined by the Trade model schema.

## OpenAPI Specification

Below is the OpenAPI 3.0 specification for the Coinrule B2B API (including the rule creation endpoint, request/response schemas, and models for rule definitions and trade results). This specification can be used to generate interactive API documentation or client libraries.

### Endpoint:

{% content-ref url="/pages/c75824692ac358e95ce273376fab63881b33d6f0" %}
[Rules](/docs/beta-api-v3/rules.md)
{% endcontent-ref %}

### Schema:

{% content-ref url="/pages/ec02f97ba634349b779e2409bd2e853a854c3feb" %}
[Broken mention](broken://pages/ec02f97ba634349b779e2409bd2e853a854c3feb)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://coinrulehq.gitbook.io/docs/beta-api-v3.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
