Skip to content

Approve a channel consumer

POST
/api/v1/channels/consumers/{realmName}/{consumerName}/grant
curl --request POST \
--url http://localhost:11044/api/v1/channels/consumers/example/example/grant \
--header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>'

JSON fields: installationId, expectedRevision, sourceKind, sourceRevision. sourceKind host adds channelName and sourceId; sourceKind realm adds sourceRealm, sourceInstallationId and sourceName. A field from the other kind is refused.

realmName
required
string

Name of the captured realm installed in the signed-in owner’s world; non-blank, at most 256 UTF-8 bytes, no control characters and not all * (400 otherwise). 409 when its live installation is not the one named by the body’s installationId and expectedRevision

consumerName
required
string

Consumer the realm declares that is to read the source the body names, replacing any source it read before; same text rules as the realm name. 400 when undeclared, when the source kind does not fit its declaration, or when its handler cannot be approved

OK

Media type*/*
Array<object>

One channel consumer a captured realm declares, and the source the owner approved it to read; answered by the /channels/consumers/{realmName} list, grant and revoke routes

object
handler
required

Name of the realm handler the consumer runs

string
handlerApproved
required

Whether that handler is approved on the installation; a consumer cannot be approved until it is

boolean
installationId
required

The live installation of that realm this was read from; send it back as installationId on a change

string
name
required

Name of the consumer, as the realm declares it

string
realmName
required

Name of the realm that declares the consumer

string
revision
required

That installation’s revision; send it back as expectedRevision on a change

integer format: int64
source

The source the consumer is approved to read; null while it is not approved

object
id
required

For host, the host channel’s source id; for realm, the installation id of the realm that produces the source

string
kind
required

One of host (a host channel) or realm (a realm’s event source)

string
realmName

Name of the realm that produces the source; null for a host channel

string
revision
required

For host, the host channel approval’s revision; for realm, the event source grant’s revision, which moves independently of the installation’s revision

integer format: int64
sourceName

Name of the event source within that realm; null for a host channel

string