Skip to main content
POST
/
hostedextractors
/
preview
Create Preview
curl --request POST \
  --url https://{cluster}.cognitedata.com/api/v1/projects/{project}/hostedextractors/preview \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "externalId": "my.known.id",
  "sourceId": "<string>",
  "config": {
    "topicFilter": "<string>"
  },
  "format": {
    "encoding": "utf8",
    "compression": "gzip"
  },
  "input": {
    "type": "protobuf",
    "messageName": "<string>",
    "files": [
      {
        "fileName": "<string>",
        "content": "<string>"
      }
    ]
  }
}
'
{
  "externalId": "my.known.id",
  "sourceId": "<string>",
  "config": {
    "topicFilter": "<string>"
  },
  "input": {
    "type": "protobuf",
    "messageName": "<string>",
    "files": [
      {
        "fileName": "<string>"
      }
    ]
  },
  "createdTime": 1730204346000,
  "format": {
    "encoding": "utf8",
    "compression": "gzip"
  }
}

Authorizations

Authorization
string
header
required

Access token issued by the CDF project's configured identity provider. Access token must be an OpenID Connect token, and the project must be configured to accept OpenID Connect tokens. Use a header key of 'Authorization' with a value of 'Bearer $accesstoken'. The token can be obtained through any flow supported by the identity provider.

Body

application/json

Preview to create.

Create object for a preview job.

externalId
string
required

The external ID provided by the client. Must be unique for the resource type.

Maximum string length: 255
Example:

"my.known.id"

sourceId
string
required

ID of the source this preview job should read from.

Maximum string length: 255
config
MQTT · object
required

Source specific job configuration. The type depends on the type of source, and is required for some sources.

format
Format · object

Input format parameters.

input
ProtoBuf · object

List of protobuf files used to define input to the mapping. This will be compiled to a collection of definitions which will be used to convert the input to JSON.

Response

Created preview.

Preview create response

externalId
string
required

The external ID provided by the client. Must be unique for the resource type.

Maximum string length: 255
Example:

"my.known.id"

sourceId
string
required

ID of the source this preview job should read from.

Maximum string length: 255
config
MQTT · object
required

Source specific job configuration. The type depends on the type of source, and is required for some sources.

input
ProtoBuf · object
required

List of protobuf files used to define input to the mapping. This will be compiled to a collection of definitions which will be used to convert the input to JSON.

createdTime
integer<int64>
required

The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds.

Required range: x >= 0
Example:

1730204346000

format
Format · object

Input format parameters.

Last modified on April 23, 2026