You can interact with the Observe platform using the Observe API to perform a variety of developer workflows, such as exporting query results to specific formats, running OPAL queries, setting up CLI automation, running AI workflows, and customizing data ingestion.
Requests to the Observe API require authentication with an API token. The token can be supplied using HTTP Bearer authentication:
// passing token as bearer token
curl -H "Authorization: Bearer <customerid> <token>" https://<customerid>.<observe-domain>.com/v1/...How to generate authentication tokens
Depending on your use case, you can generate authentication API tokens in the following ways on the Observe platform:
| Use case | How to generate your authentication token |
|---|---|
| You need to interact with the Observe API for short term, daily tasks. This type of token is tied to the user who created the token, so when the user is disabled, the token will stop working. | See Obtain a bearer token for local authentication on this page. |
| You need to set up longer term, more permanent automation or workflows. This type of token is tied to a service account and not a human user, so when the user who created the service account and token is disabled, the token still works. | See Manage service accounts. |
See Observe tokens for information about all the token types in Observe.
Obtain a bearer token for local authentication
Perform the following step to create a bearer token tied to the user creating the token:
- In the left navigation, hover over your user name and select Manage account.
- Select My API tokens.
- Click Create API token.
- Give the token a name, description, expiration date, and extension criteria. See Extension criteria for more information about you can extend your API expiration.
- Click Create to generate your token.
Extension criteria
By default, API tokens last for 30 days after they are created. You can set an extension criteria to extend the life of your token, if the token is used within ten percent of the extension criteria. For example, if your token is set to expire on July 10, here are some examples of how the various extension criteria will extend your token:
| Extension criteria | How if affects your token expiry |
|---|---|
| 1 hour | Ten percent of 1 hour is 6 minutes. If your token is used within 6 minutes of July 10, your token is extended by 1 hour. |
| 1 day | Ten percent of 1 day is 144 minutes. If your token is used within 144 minutes of July 10, your token is extended by 1 day. |
| 10 days | Ten percent of 10 days is 1 day. If your token is used on July 9, your token is extended by 10 days to July 20. |
You can extend tokens indefinitely, as long as they don't expire between extensions. Once a token expires you can't extend it anymore, you'll have to create a new token.
Token management
Perform the following step to manage your API tokens:
- In the left navigation, hover over your user name and select Manage account.
- Select My API tokens.
You can view all your API tokens on the My API tokens page. Hover on any API token to delete, disable, or edit the token.
You can only delete a token after you have disabled it first.