> This page is for Camera to 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.

# Déclencher un événement d’enregistrement en temps réel

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

Déclenche un événement sur le canal de l’appareil.

 Vous pouvez vous en servir pour enregistrer un commentaire rapide ou pour d’autres choses qui n’ont même pas encore été imaginées.

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 de canal de l’appareil
- `input_index` (integer, required) — Entier indexé à partir de 0, utilisé pour identifier l’entrée

### 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) — Code temporel représenté sous forme de chaîne SMPTE, Découvrez plus d’informations sur le code temporel [ici](https://workflow.frame.io/guide/timecode).
- `rate` (SmpteTimeRepresentationRate, optional) — Cadence d’images du flux du code temporel

### HttpErrorErrorsItems

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

### SmpteTimeRepresentationRate

Cadence d’images du flux du code temporel

- `playback` (list of integer, optional) — Vitesse de lecture de la cadence d’images, représentée sous la forme d’une paire `[numerator, denominator]` dans un tableau. En option, ce champ accepte également des fractions au format chaîne, `"numerator/denominator"`. Les cadences NTSC telles que 23,98 doivent être envoyées sous la forme d’une valeur rationnelle entièrement qualifiée : `[24000, 1001]`.
- `ntsc` (enum, optional, nullable) — La norme NTSC du code temporel. Peut être `"non_drop"` ou `null`. Si `null`, la lecture doit représenter une valeur en nombre entier, telle que `[24, 1]`. Si `"non_drop"`, la lecture doit représenter une cadence d’images NTSC valide, telle que `[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()
```