Skip to main content
POST
/
hostedextractors
/
sources
Python SDK
from cognite.client.data_classes.hosted_extractors import EventHubSourceWrite
source = EventHubSourceWrite('my_event_hub', 'http://myeventhub.com', "My EventHub", 'my_key', 'my_value')
res = client.hosted_extractors.sources.create(source)
{
  "items": [
    {
      "type": "mqtt3",
      "externalId": "my.known.id",
      "host": "<string>",
      "createdTime": 1730204346000,
      "lastUpdatedTime": 1730204346000,
      "port": 1883,
      "authentication": {
        "type": "basic",
        "username": "<string>"
      },
      "useTls": true,
      "caCertificate": {
        "thumbprint": "<string>",
        "expiresAt": 123
      },
      "authCertificate": {
        "thumbprint": "<string>",
        "expiresAt": 123
      }
    }
  ]
}

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

Sources to create.

items
(CreateMqttV3Source · object | CreateMqttV5Source · object | CreateEventHubSource · object | CreateRestSource · object | object)[]
required
Required array length: 1 - 10 elements

Response

List of created sources.

items
(MqttV3Source · object | MqttV5Source · object | EventHubSource · object | RestSource · object | object)[]
required
Maximum array length: 100
Last modified on April 23, 2026