Passer au contenu principal
POST
https://{tenantDomain}/api/v2
/
log-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.LogStreams.CreateAsync(
            new CreateLogStreamHttpRequestBody {
                Type = "http",
                Sink = new LogStreamHttpSink {
                    HttpEndpoint = "httpEndpoint"
                }
            }
        );
    }

}
package example

import (
    context "context"

    management "github.com/auth0/go-auth0/management/management"
    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 := &management.CreateLogStreamRequestContent{
        CreateLogStreamHttpRequestBody: &management.CreateLogStreamHttpRequestBody{
            Type: management.LogStreamHttpEnum(
                "http",
            ),
            Sink: &management.LogStreamHttpSink{
                HttpEndpoint: "httpEndpoint",
            },
        },
    }
    client.LogStreams.Create(
        context.TODO(),
        request,
    )
}
package com.example.usage;

import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.types.CreateLogStreamHttpRequestBody;
import com.auth0.client.mgmt.types.CreateLogStreamRequestContent;
import com.auth0.client.mgmt.types.LogStreamHttpSink;

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

        client.logStreams().create(
            CreateLogStreamRequestContent.of(
                CreateLogStreamHttpRequestBody
                    .builder()
                    .type("http")
                    .sink(
                        LogStreamHttpSink
                            .builder()
                            .httpEndpoint("httpEndpoint")
                            .build()
                    )
                    .build()
            )
        );
    }
}
<?php

namespace Example;

use Auth0\SDK\API\Management\Management;
use Auth0\SDK\API\Management\Types\CreateLogStreamHttpRequestBody;
use Auth0\SDK\API\Management\Types\LogStreamHttpSink;

$client = new Management(
    token: '<token>',
);
$client->logStreams->create(
    new CreateLogStreamHttpRequestBody([
        'type' => 'http',
        'sink' => new LogStreamHttpSink([
            'httpEndpoint' => 'httpEndpoint',
        ]),
    ]),
);
from auth0.management import ManagementClient, CreateLogStreamHttpRequestBody, LogStreamHttpSink

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

client.log_streams.create(
    request=CreateLogStreamHttpRequestBody(
        type="http",
        sink=LogStreamHttpSink(
            http_endpoint="httpEndpoint",
        ),
    ),
)
require "auth0"

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

client.log_streams.create(
  type: "http",
  sink: {
    http_endpoint: "httpEndpoint"
  }
)
import { ManagementClient } from "auth0";

async function main() {
    const client = new ManagementClient({
        token: "<token>",
    });
    await client.logStreams.create({
        type: "http",
        sink: {
            httpEndpoint: "httpEndpoint",
        },
    });
}
main();
import { ManagementClient } from "auth0";

async function main() {
    const client = new ManagementClient({
        token: "<token>",
    });
    await client.logStreams.create({
        type: "http",
        sink: {
            httpEndpoint: "httpEndpoint",
        },
    });
}
main();
curl --request POST \
  --url https://{tenantDomain}/api/v2/log-streams \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "type": "http",
  "sink": {
    "httpEndpoint": "<string>",
    "httpAuthorization": "<string>",
    "httpContentType": "<string>",
    "httpCustomHeaders": [
      {
        "header": "<string>",
        "value": "<string>"
      }
    ]
  },
  "name": "<string>",
  "isPriority": true,
  "filters": [
    {
      "type": "category"
    }
  ],
  "startFrom": "2021-03-01T19:57:29.532Z"
}
'
{
  "id": "<string>",
  "name": "<string>",
  "type": "http",
  "isPriority": true,
  "filters": [
    {
      "type": "category"
    }
  ],
  "pii_config": {
    "log_fields": [],
    "algorithm": "xxhash"
  },
  "sink": {
    "httpEndpoint": "<string>",
    "httpAuthorization": "<string>",
    "httpContentType": "<string>",
    "httpCustomHeaders": [
      {
        "header": "<string>",
        "value": "<string>"
      }
    ]
  }
}

Autorisations

Authorization
string
header
requis

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

Corps

type
enum<string>
requis
Options disponibles:
http
sink
object
requis
name
string

log stream name

isPriority
boolean

True for priority log streams, false for non-priority

filters
object[]

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

pii_config
object
startFrom
string
défaut:2021-03-01T19:57:29.532Z

The optional datetime (ISO 8601) to start streaming logs from

Réponse

Log stream created

id
string<log-stream-id>

The id of the log stream

name
string

log stream name

status
enum<string>

The status of the log stream. Possible values: active, paused, suspended

Options disponibles:
active,
paused,
suspended
type
enum<string>
Options disponibles:
http
isPriority
boolean

True for priority log streams, false for non-priority

filters
object[]

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

pii_config
object
sink
object