Skip to main content
POST
/
hostedextractors
/
mappings
Python SDK
from cognite.client.data_classes.hosted_extractors import MappingWrite, CustomMapping
mapping = MappingWrite(external_id="my_mapping", mapping=CustomMapping("some expression"), published=True, input="json")
res = client.hosted_extractors.mappings.create(mapping)
{
  "items": [
    {
      "externalId": "my.known.id",
      "mapping": {
        "expression": "<string>"
      },
      "input": {
        "type": "protobuf",
        "messageName": "<string>",
        "files": [
          {
            "fileName": "<string>"
          }
        ]
      },
      "published": true,
      "createdTime": 1730204346000,
      "lastUpdatedTime": 1730204346000
    }
  ]
}

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

Mappings to create.

items
CreateMapping · object[]
required

Response

List of created mappings

items
Mapping · object[]
required
Maximum array length: 100
Last modified on April 23, 2026