See api-docs Menu

List Environment Variables

Early Preview

This API is in early preview and may be subject to change. Please contact your account manager if you are interested in trying Smart Hooks.

Use this API to return a list of all Hook Environment Variables that have been defined in a OneLogin account.

For more detail on how to use environment variables within a hook function see the Smart Hooks Overview.

Note that because environment variables can be used to store secrets the value will not be returned via this API. You will only the see the name of the Environment Variable.

Resource URL

https://<api-domain>/api/2/hooks/envs

Header Parameters

Authorization

required

string

Set to bearer <access_token>.

Set <access_token> to the access token you generated using the Generate Token API.

The access token must have been generated using an API credential pair created using the scope required to call this API. This API can be called using any one of the following scopes: Manage All.

In order to use Smart Hooks your API Credentials must be created after 21st October 2020.

Query Parameters

Standard pagination is supported. Max page limit is 1000. See Pagination for detail on how this works.

Sample Responses

[
    {
        "id": "8148095e-1b63-4acc-b2de-ff3fc5f12561",
        "name": "MY_API_KEY",
        "created_at": "2020-08-28T01:10:14.043Z",
        "updated_at": "2020-08-28T01:10:14.043Z"
    }
]

Typically, this error means that your access token value is invalid.

{
    "name": "UnauthorizedError",
    "message": "The request requires user authentication."
}

Response Elements

id A unique identifier for the Hook Environment Variable
name The name of the environment variable.
created_at The ISO8601 formatted date that the environment variable was created.
updated_at The ISO8601 formatted date that the environment variable was last updated.

Postman Collection

Replace sample variables indicated by {{ }} with your actual values.

Download for the Smart Hooks API

Sample Code

cURL

Replace sample values indicated by < > with your actual values.

List Hook Environment Variables

curl 'https://<api-domain>/api/2/hooks/envs' \
-X GET \
-H "Authorization: bearer <access_token>"

Have a Question?

Have a how-to question? Seeing a weird error? Ask us about it on StackOverflow.

Found a bug? Submit a support ticket.

Have a product idea or request? Share it with us in our Ideas Portal.