---
title: "Declanșarea execuțiilor | Documentație | AI Assistant by R&D Copilot"
description: "Pornește pregătirea unei oferte pe baza unei cereri din integrarea ta."
canonical: "https://ai.rdcopilot.com/ro/docs/guides/triggers/"
language: ro
updated: 2026-11-22
---

# Declanșarea execuțiilor

Pornește pregătirea unei oferte pe baza unei cereri din integrarea ta.

Când integrarea primește o cerere eligibilă din CRM, salvează identificatorul cererii, identificatorul ales pentru execuție și UUID-ul operației înainte de apel. La o livrare repetată, refolosește aceleași valori și corpul cererii inițiale.

curl

```bash
curl -X POST "$RDC_BASE_URL/ai/v1/tasks/runs" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "1b5201ad-39eb-4cc1-889c-2dd2d43ffc57",
  "expectedRevision": 0,
  "runId": "run-1042",
  "requestId": "CV-1042"
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/ai/v1/tasks/runs`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "1b5201ad-39eb-4cc1-889c-2dd2d43ffc57",
    "expectedRevision": 0,
    "runId": "run-1042",
    "requestId": "CV-1042"
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/ai/v1/tasks/runs',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': '1b5201ad-39eb-4cc1-889c-2dd2d43ffc57',
        'expectedRevision': 0,
        'runId': 'run-1042',
        'requestId': 'CV-1042',
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "1b5201ad-39eb-4cc1-889c-2dd2d43ffc57",
  "expectedRevision": 0,
  "runId": "run-1042",
  "requestId": "CV-1042"
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/ai/v1/tasks/runs');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('RDC_TOKEN'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => $body,
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl);
```

C#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/ai/v1/tasks/runs");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "1b5201ad-39eb-4cc1-889c-2dd2d43ffc57",
  "expectedRevision": 0,
  "runId": "run-1042",
  "requestId": "CV-1042"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

Răspuns 202

```json
{
  "operationId": "1b5201ad-39eb-4cc1-889c-2dd2d43ffc57",
  "status": "accepted",
  "aggregateRevision": 1
}
```

Urmărește stările prin [abonamentele la webhookuri](https://ai.rdcopilot.com/ro/docs/events/subscriptions/). Adaugă execuția care așteaptă aprobarea în lista persoanei responsabile și citește revizia curentă la deschidere.
