Passer au contenu principal
PATCH
https://{tenantDomain}/api/v2
/
hooks
/
{id}
/
secrets
C#
using Auth0.ManagementApi;
using System.Threading.Tasks;
using System.Collections.Generic;

public partial class Examples
{
    public async Task Example() {
        var client = new ManagementClient(
            token: "<token>"
        );

        await client.Hooks.Secrets.UpdateAsync(
            id: "id",
            request: new Dictionary<string, string>(){
                ["key"] = "value",
            }
        );
    }

}
package example

import (
    context "context"

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

func do() {
    client := client.NewClient(
        option.WithToken(
            "<token>",
        ),
    )
    request := map[string]any{
        "key": "value",
    }
    client.Hooks.Secrets.Update(
        context.TODO(),
        "id",
        request,
    )
}
package com.example.usage;

import com.auth0.client.mgmt.ManagementApi;
import java.util.HashMap;

public class Example {
    public static void main(String[] args) {
        ManagementApi client = ManagementApi
            .builder()
            .token("<token>")
            .build();

        client.hooks().secrets().update(
            "id",
            new HashMap<String, String>() {{
                put("key", "value");
            }}
        );
    }
}
<?php

namespace Example;

use Auth0\SDK\API\Management\Management;

$client = new Management(
    token: '<token>',
);
$client->hooks->secrets->update(
    'id',
    [
        'key' => 'value',
    ],
);
from auth0.management import ManagementClient

client = ManagementClient(
    token="<token>",
)

client.hooks.secrets.update(
    id="id",
    request={
        "key": "value"
    },
)
require "auth0"

client = Auth0::Management.new(token: "<token>")

client.hooks.secrets.update(
  id: "id",
  request: {
    key: "value"
  }
)
import { ManagementClient } from "auth0";

async function main() {
    const client = new ManagementClient({
        token: "<token>",
    });
    await client.hooks.secrets.update("id", {
        "key": "value",
    });
}
main();
import { ManagementClient } from "auth0";

async function main() {
    const client = new ManagementClient({
        token: "<token>",
    });
    await client.hooks.secrets.update("id", {
        "key": "value",
    });
}
main();
curl --request PATCH \
  --url https://{tenantDomain}/api/v2/hooks/{id}/secrets \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{}'

Autorisations

Authorization
string
header
requis

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

Paramètres de chemin

id
string
requis

ID of the hook whose secrets to update.

Corps

Hashmap of key-value pairs where the value must be a string.

{key}
string

Réponse

Hook secrets successfully updated.