API tokens can be created through the Metronome app.
Click on Developer in the navigation bar.
Click on API tokens in the horizontal navigation bar on the resulting page.
Click on the + Add button.
Enter a descriptive name for the token and click Create new token.
Copy the token string to a secure location before clicking Done.
SAVE YOUR TOKENBe sure to save the token you create. You cannot view the full token again.
Create as many tokens as is useful, providing descriptive names for each. The token’s name is associated with API calls made using it, which can be helpful when tracking changes and requests in the Metronome’s audit logs.
When making API calls, provide the token using the Authorization header. If using the SDK, the SDK will look for the API key under the environment variable METRONOME_BEARER_TOKEN by default. See SDK documentation for more details.
from metronome import Metronomeclient = Metronome( # Defaults to os.environ.get("METRONOME_BEARER_TOKEN") if omitted bearer_token="My bearer token",)
import Metronome from "@metronome/sdk";const client = new Metronome({ // Defaults to os.environ.get("METRONOME_BEARER_TOKEN") if omitted bearerToken: "My bearer token",});
require "bundler/setup"require "metronome_sdk"metronome = MetronomeSDK::Client.new( bearer_token: "My Bearer Token" # defaults to ENV["METRONOME_BEARER_TOKEN"])
If your token is valid, you’ll receive a JSON payload from the API—either data (if the endpoint returns records) or a 404 JSON error object if no resources are found.If your token is invalid, you’ll receive a 401 or 403 error. See API status codes for more detail.
By default, Metronome API tokens will retain the same permissions as the user that created them. Metronome API tokens can also be limited in scope to reduce risk and follow the principle of least privilege. Metronome supports scoping by:
Metronome enables archiving tokens that are no longer in use. To do this, simply hit the Trash icon next to the relevant token in the Metronome UI. This action cannot be undone.
BEST PRACTICESFollow security best practices by removing unused tokens and regularly rotating tokens in use.
Assistant
Responses are generated using AI and may contain mistakes.