> This page is for Da videocamera a cloud.

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

# Attiva un evento di registrazione in tempo reale

POST https://api.frame.io/v2/devices/channels/{channel_id}/inputs/{input_index}/trigger
Content-Type: application/json

Attiva un evento sul canale del dispositivo.

 Puoi usarlo per la registrazione di un commento rapido o per altre attività non ancora previste.

Reference: https://next.developer.frame.io/camera-to-cloud/api-reference/device-channels/trigger-realtime-logging-event

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `channel_id` (string, required) — ID canale del dispositivo
- `input_index` (integer, required) — Un numero intero indicizzato a partire da 0 che serve a identificare l’input

### Headers

- `x-client-version` (string, optional, default: 0.0.0) — Firmware or software version of a C2C integration. Will be used to determine the correct Device Model configuration for the device when multiple are available. Must be a valid semantic version. For more on semantic versions, see here: https://semver.org/

### Body (application/json)

This endpoint expects an object.

- `action_type` (enum, optional)
  - Allowed values: `single_press`
- `offset` (integer, optional)
- `start` (SMPTETimeRepresentation, optional)
- `duration` (SMPTETimeRepresentation, optional)

## Response

### 204

OK

## Errors

### 401 Unauthorized Error

Unauthorized response

- `code` (integer, optional)
- `errors` (list of HttpErrorErrorsItems, optional)
- `message` (string, optional)

## Types

### SMPTETimeRepresentation

- `smpte_timecode` (string, optional) — Codice orario rappresentato come stringa SMPTE, Scopri di più sul codice orario [qui](https://workflow.frame.io/guide/timecode)!
- `rate` (SmpteTimeRepresentationRate, optional) — Frequenza di fotogrammi del flusso con codice orario

### HttpErrorErrorsItems

- `code` (integer, optional)
- `detail` (string, optional)
- `status` (integer, optional)
- `title` (string, optional)

### SmpteTimeRepresentationRate

Frequenza di fotogrammi del flusso con codice orario

- `playback` (list of integer, optional) — Velocità di riproduzione della frequenza dei fotogrammi, rappresentata come coppia `[numerator, denominator]` in una serie. Facoltativamente, questo campo accetta anche frazioni in formato stringa, `"numerator/denominator"`. Le frequenza dei fotogrammi NTSC, ad esempio 23.98, vanno inviate come valore razionale completo: `[24000, 1001]`.
- `ntsc` (enum, optional, nullable) — Lo standard NTSC del codice orario. Può essere `"non_drop"` o `null`. Se `null`, la riproduzione deve rappresentare un valore intero, ad esempio `[24, 1]`. Se `"non_drop"`, la riproduzione deve rappresentare una frequenza dei fotogrammi NTSC valida, ad esempio `[24000, 1001]`.
  - Allowed values: `ntsc`

## Examples

**Request**

```json
{
  "body": {
    "action_type": "single_press",
    "duration": {
      "rate": {
        "ntsc": "non_drop",
        "playback": [
          24000,
          1001
        ]
      },
      "smpte_timecode": "00:00:00:01"
    },
    "offset": 0,
    "start": {
      "rate": {
        "ntsc": "non_drop",
        "playback": [
          24000,
          1001
        ]
      },
      "smpte_timecode": "01:00:00:00"
    }
  }
}
```

**SDK Code**

```typescript
const response = await fetch('https://api.frame.io/v2/devices/channels/{channel_id}/inputs/{input_index}/trigger', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer [access_token]',
    'Content-Type': 'application/json',
    'x-client-version': '2.0.0'
  },
  body: JSON.stringify({
    action_type: 'single_press',
    offset: 0,
    start: {
      smpte_timecode: '01:00:00:00',
      rate: {
        playback: [24000, 1001],
        ntsc: 'non_drop'
      }
    },
    duration: {
      smpte_timecode: '00:00:00:01',
      rate: {
        playback: [24000, 1001],
        ntsc: 'non_drop'
      }
    }
  })
});

const result = await response.json();
console.log(result);
```

```python
import requests

headers = {
    'Authorization': 'Bearer [access_token]',
    'Content-Type': 'application/json',
    'x-client-version': '2.0.0'
}

data = {
    'action_type': 'single_press',
    'offset': 0,
    'start': {
        'smpte_timecode': '01:00:00:00',
        'rate': {
            'playback': [24000, 1001],
            'ntsc': 'non_drop'
        }
    },
    'duration': {
        'smpte_timecode': '00:00:00:01',
        'rate': {
            'playback': [24000, 1001],
            'ntsc': 'non_drop'
        }
    }
}

response = requests.post(
    'https://api.frame.io/v2/devices/channels/{channel_id}/inputs/{input_index}/trigger',
    headers=headers,
    json=data
)

result = response.json()
print(result)
```

```go
package main

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

func main() {

	url := "https://api.frame.io/v2/devices/channels/:channel_id/inputs/:input_index/trigger"

	payload := strings.NewReader("{\n  \"body\": {\n    \"action_type\": \"single_press\",\n    \"duration\": {\n      \"rate\": {\n        \"ntsc\": \"non_drop\",\n        \"playback\": [\n          24000,\n          1001\n        ]\n      },\n      \"smpte_timecode\": \"00:00:00:01\"\n    },\n    \"offset\": 0,\n    \"start\": {\n      \"rate\": {\n        \"ntsc\": \"non_drop\",\n        \"playback\": [\n          24000,\n          1001\n        ]\n      },\n      \"smpte_timecode\": \"01:00:00:00\"\n    }\n  }\n}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	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://api.frame.io/v2/devices/channels/:channel_id/inputs/:input_index/trigger")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"body\": {\n    \"action_type\": \"single_press\",\n    \"duration\": {\n      \"rate\": {\n        \"ntsc\": \"non_drop\",\n        \"playback\": [\n          24000,\n          1001\n        ]\n      },\n      \"smpte_timecode\": \"00:00:00:01\"\n    },\n    \"offset\": 0,\n    \"start\": {\n      \"rate\": {\n        \"ntsc\": \"non_drop\",\n        \"playback\": [\n          24000,\n          1001\n        ]\n      },\n      \"smpte_timecode\": \"01:00:00:00\"\n    }\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://api.frame.io/v2/devices/channels/:channel_id/inputs/:input_index/trigger")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"body\": {\n    \"action_type\": \"single_press\",\n    \"duration\": {\n      \"rate\": {\n        \"ntsc\": \"non_drop\",\n        \"playback\": [\n          24000,\n          1001\n        ]\n      },\n      \"smpte_timecode\": \"00:00:00:01\"\n    },\n    \"offset\": 0,\n    \"start\": {\n      \"rate\": {\n        \"ntsc\": \"non_drop\",\n        \"playback\": [\n          24000,\n          1001\n        ]\n      },\n      \"smpte_timecode\": \"01:00:00:00\"\n    }\n  }\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.frame.io/v2/devices/channels/:channel_id/inputs/:input_index/trigger', [
  'body' => '{
  "body": {
    "action_type": "single_press",
    "duration": {
      "rate": {
        "ntsc": "non_drop",
        "playback": [
          24000,
          1001
        ]
      },
      "smpte_timecode": "00:00:00:01"
    },
    "offset": 0,
    "start": {
      "rate": {
        "ntsc": "non_drop",
        "playback": [
          24000,
          1001
        ]
      },
      "smpte_timecode": "01:00:00:00"
    }
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.frame.io/v2/devices/channels/:channel_id/inputs/:input_index/trigger");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"body\": {\n    \"action_type\": \"single_press\",\n    \"duration\": {\n      \"rate\": {\n        \"ntsc\": \"non_drop\",\n        \"playback\": [\n          24000,\n          1001\n        ]\n      },\n      \"smpte_timecode\": \"00:00:00:01\"\n    },\n    \"offset\": 0,\n    \"start\": {\n      \"rate\": {\n        \"ntsc\": \"non_drop\",\n        \"playback\": [\n          24000,\n          1001\n        ]\n      },\n      \"smpte_timecode\": \"01:00:00:00\"\n    }\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["body": [
    "action_type": "single_press",
    "duration": [
      "rate": [
        "ntsc": "non_drop",
        "playback": [24000, 1001]
      ],
      "smpte_timecode": "00:00:00:01"
    ],
    "offset": 0,
    "start": [
      "rate": [
        "ntsc": "non_drop",
        "playback": [24000, 1001]
      ],
      "smpte_timecode": "01:00:00:00"
    ]
  ]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.frame.io/v2/devices/channels/:channel_id/inputs/:input_index/trigger")! 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()
```