Docs Menu

Manage User API Keys - Swift SDK

On this page

  • Create a User API Key
  • Look up a User API Key
  • Enable or Disable a User API Key
  • Delete a User API Key

You can manage a user API key with a user's API Key auth instance, which you can access through the user's apiKeysAuth property.

You can create a user API key with the API key auth instance's createAPIKey method.

Important
Store the API Key Value

The SDK only returns the value of the user API key when you create it. Make sure to store the key value securely so that you can use it to log in.

If you lose or do not store the key value there is no way to recover it. You will need to create a new user API key.

You can look up a user API key with the API key auth instance's fetchAPIKey method.

You can enable or disable a user API key with the API key auth instance's enableAPIKey and disableAPIKey methods.

You can delete a user API key with the API key auth instance's deleteAPIKey method.

Give Feedback
MongoDB logo
© 2021 MongoDB, Inc.

About

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