Skip to content

Create a stream

POST
/content/management/v1/streams
curl --request POST \
--url https://api.ebitex.io/content/management/v1/streams \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "externalId": "example", "name": "example", "sourceContractIds": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "adapterId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "orderByFieldPath": "example", "orderDescending": true, "resolveDepth": 1, "excludedComponentIds": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "declaredFilters": [ { "key": "example", "type": "example", "fieldPath": "example", "labelFieldPath": "example", "groupExternalId": "example" } ] }'

Creates a stream definition:

  • sourceContractIds: one to ten contracts. A contract also matches every contract that inherits from it.
  • adapterId: an optional adapter every item is mapped through. Every source contract must satisfy the adapter’s input contract.
  • orderByFieldPath and orderDescending: the order, by one top-level field.
  • resolveDepth: 0 to 10, how many levels of references each item’s content expands.
  • excludedComponentIds: up to 100 components to leave out.
  • declaredFilters: up to five filters callers may use, each { key, type, fieldPath, labelFieldPath, groupExternalId }. type is string, category, reference, date or fullText (at most one).

Delivery reads stream definitions live, so a saved stream is served at once, with no publish step. Only the content it lists has to be published.

Key: a management key with content.management.authoring.

Media typeapplication/json
object
externalId
required
string
name
required
string
sourceContractIds
required
Array<string>
adapterId
required
null | string format: uuid
orderByFieldPath
required
null | string
orderDescending
required
boolean
resolveDepth
required
integer | string format: int32
/^-?(?:0|[1-9]\d*)$/
excludedComponentIds
required
Array<string> | null
declaredFilters
required
Array<object> | null
object
key
required
string
type
required
string
fieldPath
null | string
labelFieldPath
null | string
groupExternalId
null | string
Examplegenerated
{
"externalId": "example",
"name": "example",
"sourceContractIds": [
"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
],
"adapterId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"orderByFieldPath": "example",
"orderDescending": true,
"resolveDepth": 1,
"excludedComponentIds": [
"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
],
"declaredFilters": [
{
"key": "example",
"type": "example",
"fieldPath": "example",
"labelFieldPath": "example",
"groupExternalId": "example"
}
]
}

The created stream, shaped as getStream returns it.

validation_failed: externalId is not valid kebab-case of 3 to 64 characters, or name is empty.

missing_api_key or invalid_api_key: no key was sent, or it is unknown, revoked or expired.

payment_required: the organization’s subscription needs attention.

permission_denied: the key’s role lacks content.streams.manage.

scope_denied: the key lacks this route’s scope. tier_required: the Content Management API needs the Pro plan or above. ip_denied: the caller’s address is outside the key’s allowed ranges. app_not_available: Content is not enabled for the organization.

duplicate_external_id: a stream with this external id already exists in the environment.

stream_invalid: the definition cannot be saved. errors lists each problem as { target, code, message }, for example source_contracts_required, too_many_source_contracts, contract_not_found, adapter_not_found, stream_adapter_input_unsatisfied (a source contract does not satisfy the adapter’s input contract), invalid_field_path, invalid_resolve_depth, too_many_exclusions, too_many_filters, duplicate_filter_key, unknown_filter_type, multiple_fulltext_filters and unknown_category_group.

Rate limit or quota exceeded; Retry-After says how long to wait. too_many_failed_authentications: too many bad keys from this address.