Docs Menu

Call a Service Action

On this page

  • Overview
  • Call from a Function

You can call actions associated with a service from Realm Functions, including incoming webhooks and triggers, or directly from a connected client application. Each service action is available as a method on its respective service client.


You must configure a service rule that enables an action before you can call it.

The examples in this section demonstrate calling the post() action from the HTTP Service. Each service action follows a similar pattern but has distinct parameters. For details on the parameters and usage of a specific action, refer to that action's reference page.

To call a service action from a function:

  1. Instantiate a service client from application context using the global variable.
  2. Call the method associated with the action.
const http ="myHttpService");{
"url": "",
"headers": { "Content-Type": ["application/json"] },
"body": { "msg": "Hello from a service action!" }
.then(() => "Successfully sent the post request!")
Give Feedback
MongoDB logo
© 2021 MongoDB, Inc.


  • Careers
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2021 MongoDB, Inc.