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

# Reportar conexión, versión o salud de un plugin

POST https://app.recurrente.com/api/plugin_events
Content-Type: application/json

Registra telemetría reportada por la integración para la cuenta autenticada.
No acepta montos ni confirmaciones de pagos. No demuestra un censo completo
de instalaciones. Los eventos de Sandbox quedan fuera del dashboard LIVE.
Envía Idempotency-Key en reintentos para evitar duplicar eventos.
El orden es la recepción en el servidor; no se aceptan fechas del cliente.


Reference: https://docs.recurrente.com/referencia-api/api-reference/plugins/create-plugin-event

## Authentication

- `X-SECRET-KEY` header (required) — Tu clave secreta de API. Una llave de cuenta (`sk_live_...`, `sk_test_...`) opera sobre su propia cuenta y, con `X-ACCOUNT-ID`, sobre sus cuentas conectadas. La llave también fija el ambiente: una `sk_test_` solo lista y resuelve objetos de prueba (`live_mode: false`) y una `sk_live_` solo objetos reales. Un ID del otro ambiente responde `404` (`401` en `/customers`). Una llave de organización (`sk_org_live_...`, `sk_org_test_...`) alcanza todas las cuentas de una organización y solo sirve para leer: saldos, movimientos y reportes. Para operar sobre una cuenta debe nombrarla con `X-ACCOUNT-ID`; omitirlo en una lectura devuelve todas las cuentas de la organización. Cualquier otro endpoint responde `403` con `code: organization_key_unsupported`.

## Request

### Body (application/json)

This endpoint expects an object.

- `plugin_event` (PluginEventInput, required)

## Response

### 201

Telemetría recibida; no confirma un pago.

- `plugin` (enum, required)
  - Allowed values: `shopify`, `woocommerce`, `gohighlevel`, `odoo`
- `installation_id` (string, required) — Identificador estable de la tienda o instalación dentro de la cuenta.
- `event` (enum, required)
  - Allowed values: `connected`, `disconnected`, `heartbeat`, `error`, `recovered`
- `id` (string, required)
- `received_at` (datetime, required) — Fecha de recepción del evento en Recurrente.
- `version` (string, optional) — Versión observada por el plugin; omitir si no se conoce.
- `site` (string, optional) — Nombre o dominio de la tienda, sin secretos ni datos de compradores.
- `error_code` (enum, optional) — Obligatorio para event=error; recovered indica recuperación reportada.
  - Allowed values: `authentication_failed`, `webhook_failed`, `api_error`, `connection_failed`

## Errors

### 401 Unauthorized Error

Autenticación inválida.

- `any`

### 403 Forbidden Error

Llave de solo lectura o de organización no permitida.

- `any`

### 422 Unprocessable Entity Error

Plugin, tipo de evento o campos inválidos.

- `any`

## Types

### PluginEventInput

- `plugin` (enum, required)
  - Allowed values: `shopify`, `woocommerce`, `gohighlevel`, `odoo`
- `installation_id` (string, required) — Identificador estable de la tienda o instalación dentro de la cuenta.
- `event` (enum, required)
  - Allowed values: `connected`, `disconnected`, `heartbeat`, `error`, `recovered`
- `version` (string, optional) — Versión observada por el plugin; omitir si no se conoce.
- `site` (string, optional) — Nombre o dominio de la tienda, sin secretos ni datos de compradores.
- `error_code` (enum, optional) — Obligatorio para event=error; recovered indica recuperación reportada.
  - Allowed values: `authentication_failed`, `webhook_failed`, `api_error`, `connection_failed`

## Examples

**Request**

```json
{
  "plugin_event": {
    "plugin": "shopify",
    "installation_id": "tienda.myshopify.com",
    "event": "connected"
  }
}
```

**Response**

```json
{
  "plugin": "shopify",
  "installation_id": "tienda.myshopify.com",
  "event": "connected",
  "id": "act_ab12cd34",
  "received_at": "2024-01-15T09:30:00Z",
  "version": "0.1.1",
  "site": "tienda.example.com",
  "error_code": "authentication_failed"
}
```

**SDK Code**

```python
import requests

url = "https://app.recurrente.com/api/plugin_events"

payload = { "plugin_event": {
        "plugin": "shopify",
        "installation_id": "tienda.myshopify.com",
        "event": "connected"
    } }
headers = {
    "X-SECRET-KEY": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://app.recurrente.com/api/plugin_events';
const options = {
  method: 'POST',
  headers: {'X-SECRET-KEY': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"plugin_event":{"plugin":"shopify","installation_id":"tienda.myshopify.com","event":"connected"}}'
};

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

```go
package main

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

func main() {

	url := "https://app.recurrente.com/api/plugin_events"

	payload := strings.NewReader("{\n  \"plugin_event\": {\n    \"plugin\": \"shopify\",\n    \"installation_id\": \"tienda.myshopify.com\",\n    \"event\": \"connected\"\n  }\n}")

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

	req.Header.Add("X-SECRET-KEY", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

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

url = URI("https://app.recurrente.com/api/plugin_events")

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

request = Net::HTTP::Post.new(url)
request["X-SECRET-KEY"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"plugin_event\": {\n    \"plugin\": \"shopify\",\n    \"installation_id\": \"tienda.myshopify.com\",\n    \"event\": \"connected\"\n  }\n}"

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

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

HttpResponse<String> response = Unirest.post("https://app.recurrente.com/api/plugin_events")
  .header("X-SECRET-KEY", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"plugin_event\": {\n    \"plugin\": \"shopify\",\n    \"installation_id\": \"tienda.myshopify.com\",\n    \"event\": \"connected\"\n  }\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://app.recurrente.com/api/plugin_events', [
  'body' => '{
  "plugin_event": {
    "plugin": "shopify",
    "installation_id": "tienda.myshopify.com",
    "event": "connected"
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-SECRET-KEY' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://app.recurrente.com/api/plugin_events");
var request = new RestRequest(Method.POST);
request.AddHeader("X-SECRET-KEY", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"plugin_event\": {\n    \"plugin\": \"shopify\",\n    \"installation_id\": \"tienda.myshopify.com\",\n    \"event\": \"connected\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-SECRET-KEY": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["plugin_event": [
    "plugin": "shopify",
    "installation_id": "tienda.myshopify.com",
    "event": "connected"
  ]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://app.recurrente.com/api/plugin_events")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```