You should unsubscribe from a stream layer when you are no longer consuming data from a subscription. This means that your app's shutdown sequence should unsubscribe using the API described below. This cleans up resources and is considered a best practice.
To unsubscribe from a stream layer, use the
stream API. In the request, the values for
subscriptionId are the ones returned in the response of the subscription request describe in Get data from a stream layer.
DELETE /layers/<Layer ID>/subscribe?subscriptionId=<subscriptionId> HTTP/1.1
Authorization: Bearer <Authorization Token>