Docs Menu

API Key Authentication

On this page

  • Overview
  • Server API Keys
  • User API Keys
  • Configuration
  • Create a Server API Key
  • Examples
  • Summary

The API Key authentication provider allows users to log in using generated keys. There are two types of API keys in Atlas App Services: server keys and user keys.

Server API keys are generated in the Atlas App Services UI. Creating a server API key associates that API key with an automatically created App Services server user. Provide a server key to external applications and services to allow them to authenticate directly with App Services.

You can associate up to 100 server API keys with an app.

User API keys are generated for specific application users by the client SDKs. You can allow devices or services to communicate with App Services on behalf of a user by associating a unique user API key with each device.

User API keys are always associated with a non-anonymous user. Each user can associate up to 20 user API keys with their account.


The API Key authentication provider does not have any provider-specific configuration options.


Remember to copy the server key's value as soon as you create it. Once you leave the provider configuration page or disable the key you cannot retrieve the value from the Atlas App Services UI.

For code examples that demonstrate how to register and log in using API Key authentication, see the documentation for the Realm SDKs:

  • The App Services API Key authentication provider allows users and services to connect to an App using API keys that look like a string of characters.
  • User API Keys allow a user to interact with services via the a Realm SDK. They are automatically generated in the client SDK.
  • Server API Keys allow external services to interact with your App. These keys can only be generated via the Atlas App Services UI.
←  Custom Function AuthenticationFacebook Authentication →
Give Feedback
© 2022 MongoDB, Inc.


  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2022 MongoDB, Inc.