Skip to content
中文

Retrieve event subscription

Code Mode: praxis.events.subscriptions.retrieve

HTTP: GET /events/v1/subscriptions/{subscription_id}

Read one subscription to check its filters, its sink and when it expires. Take the id from subscriptions.create or subscriptions.list. A subscription that does not exist, has expired, belongs to someone else or to another organization answers the same 404 SUBSCRIPTION_NOT_FOUND. Read-only.

Signature

praxis.events.subscriptions.retrieve(args:{path:{/** e.g. "esub_0123456789abcdef0123456789abcdef" */ subscription_id:string}}):Promise<{/** The subscription id, esub_...; use it to retrieve or delete it. */ id:string;/** The tenant event types it listens to. */ types:Array<string>;/** The conditions that must all hold; empty means every event of the types. */ filters:Array<{/** The attribute equals the value, for example { subject: "runs/run_1" } or { "data.status": "faulted" }. */ exact?:{[key:string]:string};/** The attribute starts with the value, for example { subject: "runs/" }. */ prefix?:{[key:string]:string}}>;/** The inbox address the letters go to, agent:<id> or human:<id>. */ sink:string;/** Whether the subscription ends after its first letter. */ once:boolean;/** When the subscription ends and stops matching, RFC 3339. */ expires_at:string;/** When the subscription was created, RFC 3339. */ created_at:string;/** The address that created it, agent:<id> or human:<id>; only that caller can see it. */ created_by:string}>;

Parameters

NameInTypeRequiredDescription
subscription_idpathstringyesSubscription id returned by subscriptions.create or subscriptions.list, in the form esub_ followed by letters and digits.

Responses

StatusContent typesDescription
200application/jsonThe subscription.
401application/problem+jsonUNAUTHENTICATED means the credential is missing or invalid; send a valid Praxis credential of your organization.
404application/problem+jsonSUBSCRIPTION_NOT_FOUND means no live subscription with this id belongs to you; it was deleted, it expired, a once subscription fired, or it is someone else’s. List subscriptions to find an id you can reach.
503application/problem+jsonPROVIDER_UNAVAILABLE with retryable true means the event catalog or the inbox service cannot answer right now; wait a few seconds and repeat the same call.