Passer au contenu principal
POST
https://{tenantDomain}/api/v2
/
event-streams
C#
using Auth0.ManagementApi;
using System.Threading.Tasks;

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

        await client.EventStreams.CreateAsync(
            new CreateEventStreamWebHookRequestContent {
                Destination = new EventStreamWebhookDestination {
                    Type = "webhook",
                    Configuration = new EventStreamWebhookConfiguration {
                        WebhookEndpoint = "webhook_endpoint",
                        WebhookAuthorization = new EventStreamWebhookBasicAuth {
                            Method = "basic",
                            Username = "username"
                        }
                    }
                }
            }
        );
    }

}
{
  "id": "<string>",
  "name": "<string>",
  "subscriptions": [
    {
      "event_type": "<string>"
    }
  ],
  "destination": {
    "type": "webhook",
    "configuration": {
      "webhook_endpoint": "<string>",
      "webhook_authorization": {
        "method": "basic",
        "username": "<string>"
      }
    }
  },
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}

Autorisations

Authorization
string
header
requis

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

Corps

destination
object
requis
name
string

Name of the event stream.

Required string length: 1 - 128
subscriptions
object[]

List of event types subscribed to in this stream.

Minimum array length: 1
status
enum<string>

Indicates whether the event stream is actively forwarding events.

Options disponibles:
enabled,
disabled
Maximum string length: 8

Réponse

Event Stream stream created successfully.

id
string<event-stream-id>

Unique identifier for the event stream.

Required string length: 26
name
string

Name of the event stream.

Required string length: 1 - 128
subscriptions
object[]

List of event types subscribed to in this stream.

Minimum array length: 1
destination
object
status
enum<string>

Indicates whether the event stream is actively forwarding events.

Options disponibles:
enabled,
disabled
Maximum string length: 8
created_at
string<date-time>

Timestamp when the event stream was created.

updated_at
string<date-time>

Timestamp when the event stream was last updated.