Skip to main content
GET
https://{tenantDomain}/api/v2
/
hooks
/
{id}
Go
package example

import (
    client "github.com/auth0/go-auth0/management/client"
    option "github.com/auth0/go-auth0/management/option"
    context "context"
    management "github.com/auth0/go-auth0/management"
)

func do() () {
    client := client.NewClient(
        option.WithToken(
            "<token>",
        ),
    )
    client.Hooks.Get(
        context.TODO(),
        "id",
        &management.GetHookRequestParameters{
            Fields: management.String(
                "fields",
            ),
        },
    )
}
{
  "triggerId": "<string>",
  "id": "00001",
  "name": "hook",
  "enabled": true,
  "script": "module.exports = function(client, scope, audience, context, cb) cb(null, access_token); };",
  "dependencies": {}
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

ID of the hook to retrieve.

Pattern: ^[A-Za-z0-9-]*$

Query Parameters

fields
string

Comma-separated list of fields to include in the result. Leave empty to retrieve all fields.

Pattern: ^((id)|(name)|(script)|(dependencies)|(enabled)|(triggerId))(,((id)|(name)|(script)|(dependencies)|(enabled)|(triggerId)))*$

Response

Hook successfully retrieved.

triggerId
string

Trigger ID

id
string
default:00001

ID of this hook.

name
string
default:hook

Name of this hook.

enabled
boolean
default:true

Whether this hook will be executed (true) or ignored (false).

script
string
default:module.exports = function(client, scope, audience, context, cb) cb(null, access_token); };

Code to be executed when this hook runs.

dependencies
object

Dependencies of this hook used by webtask server.