Passer au contenu principal
POST
https://{tenantDomain}/api/v2
/
event-streams
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.EventStreams.Create(
        context.TODO(),
        &management.EventStreamsCreateRequest{
            CreateEventStreamWebHookRequestContent: &management.CreateEventStreamWebHookRequestContent{
                Destination: &management.EventStreamWebhookDestination{
                    Configuration: &management.EventStreamWebhookConfiguration{
                        WebhookEndpoint: "webhook_endpoint",
                        WebhookAuthorization: &management.EventStreamWebhookAuthorizationResponse{
                            EventStreamWebhookBasicAuth: &management.EventStreamWebhookBasicAuth{
                                Username: "username",
                            },
                        },
                    },
                },
            },
        },
    )
}
{
  "id": "<string>",
  "name": "<string>",
  "subscriptions": [
    {
      "event_type": "<string>"
    }
  ],
  "destination": {
    "type": "webhook",
    "configuration": {
      "webhook_endpoint": "<string>",
      "webhook_authorization": {
        "method": "basic",
        "username": "<string>"
      }
    }
  },
  "status": "enabled",
  "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.