using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Experimentation;
public partial class Examples
{
public async Task Example() {
var client = new ManagementApiClient(
token: "<token>",
clientOptions: new ClientOptions { BaseUrl = "https://{YOUR_DOMAIN}/api/v2" }
);
await client.Experimentation.Segments.UpdateAsync(
id: "id",
request: new UpdateSegmentRequestContent()
);
}
}package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.experimentation.types.UpdateSegmentRequestContent;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.experimentation().segments().update(
"id",
UpdateSegmentRequestContent
.builder()
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Experimentation\Segments\Requests\UpdateSegmentRequestContent;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->experimentation->segments->update(
'id',
new UpdateSegmentRequestContent([]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.experimentation.segments.update(
id="id",
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.experimentation.segments.update(id: "id")
curl --request PATCH \
--url https://{tenantDomain}/api/v2/experimentation/segments/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"rules": [
{
"match": {
"client_id": [
"<string>"
],
"connection": [
"<string>"
],
"connection_type": [
"<string>"
],
"organization_id": [
"<string>"
],
"domain": [
"<string>"
],
"device_type": [
"<string>"
],
"browser": [
"<string>"
],
"platform": [
"<string>"
],
"user_agent": [
"<string>"
],
"country": [
"<string>"
],
"region": [
"<string>"
]
},
"not_match": {
"client_id": [
"<string>"
],
"connection": [
"<string>"
],
"connection_type": [
"<string>"
],
"organization_id": [
"<string>"
],
"domain": [
"<string>"
],
"device_type": [
"<string>"
],
"browser": [
"<string>"
],
"platform": [
"<string>"
],
"user_agent": [
"<string>"
],
"country": [
"<string>"
],
"region": [
"<string>"
]
}
}
]
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
rules: [
{
match: {
client_id: ['<string>'],
connection: ['<string>'],
connection_type: ['<string>'],
organization_id: ['<string>'],
domain: ['<string>'],
device_type: ['<string>'],
browser: ['<string>'],
platform: ['<string>'],
user_agent: ['<string>'],
country: ['<string>'],
region: ['<string>']
},
not_match: {
client_id: ['<string>'],
connection: ['<string>'],
connection_type: ['<string>'],
organization_id: ['<string>'],
domain: ['<string>'],
device_type: ['<string>'],
browser: ['<string>'],
platform: ['<string>'],
user_agent: ['<string>'],
country: ['<string>'],
region: ['<string>']
}
}
]
})
};
fetch('https://{tenantDomain}/api/v2/experimentation/segments/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{tenantDomain}/api/v2/experimentation/segments/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"rules\": [\n {\n \"match\": {\n \"client_id\": [\n \"<string>\"\n ],\n \"connection\": [\n \"<string>\"\n ],\n \"connection_type\": [\n \"<string>\"\n ],\n \"organization_id\": [\n \"<string>\"\n ],\n \"domain\": [\n \"<string>\"\n ],\n \"device_type\": [\n \"<string>\"\n ],\n \"browser\": [\n \"<string>\"\n ],\n \"platform\": [\n \"<string>\"\n ],\n \"user_agent\": [\n \"<string>\"\n ],\n \"country\": [\n \"<string>\"\n ],\n \"region\": [\n \"<string>\"\n ]\n },\n \"not_match\": {\n \"client_id\": [\n \"<string>\"\n ],\n \"connection\": [\n \"<string>\"\n ],\n \"connection_type\": [\n \"<string>\"\n ],\n \"organization_id\": [\n \"<string>\"\n ],\n \"domain\": [\n \"<string>\"\n ],\n \"device_type\": [\n \"<string>\"\n ],\n \"browser\": [\n \"<string>\"\n ],\n \"platform\": [\n \"<string>\"\n ],\n \"user_agent\": [\n \"<string>\"\n ],\n \"country\": [\n \"<string>\"\n ],\n \"region\": [\n \"<string>\"\n ]\n }\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "<string>",
"name": "<string>",
"type": "self",
"status": "active",
"rules": [
{
"match": {
"client_id": [
"<string>"
],
"connection": [
"<string>"
],
"connection_type": [
"<string>"
],
"organization_id": [
"<string>"
],
"domain": [
"<string>"
],
"device_type": [
"<string>"
],
"browser": [
"<string>"
],
"platform": [
"<string>"
],
"user_agent": [
"<string>"
],
"country": [
"<string>"
],
"region": [
"<string>"
]
},
"not_match": {
"client_id": [
"<string>"
],
"connection": [
"<string>"
],
"connection_type": [
"<string>"
],
"organization_id": [
"<string>"
],
"domain": [
"<string>"
],
"device_type": [
"<string>"
],
"browser": [
"<string>"
],
"platform": [
"<string>"
],
"user_agent": [
"<string>"
],
"country": [
"<string>"
],
"region": [
"<string>"
]
}
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>"
}Update a segment.
Partially update a segment by ID. Only provided fields are updated. Sending rules replaces the entire rules array.
using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Experimentation;
public partial class Examples
{
public async Task Example() {
var client = new ManagementApiClient(
token: "<token>",
clientOptions: new ClientOptions { BaseUrl = "https://{YOUR_DOMAIN}/api/v2" }
);
await client.Experimentation.Segments.UpdateAsync(
id: "id",
request: new UpdateSegmentRequestContent()
);
}
}package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.experimentation.types.UpdateSegmentRequestContent;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.experimentation().segments().update(
"id",
UpdateSegmentRequestContent
.builder()
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Experimentation\Segments\Requests\UpdateSegmentRequestContent;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->experimentation->segments->update(
'id',
new UpdateSegmentRequestContent([]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.experimentation.segments.update(
id="id",
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.experimentation.segments.update(id: "id")
curl --request PATCH \
--url https://{tenantDomain}/api/v2/experimentation/segments/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"rules": [
{
"match": {
"client_id": [
"<string>"
],
"connection": [
"<string>"
],
"connection_type": [
"<string>"
],
"organization_id": [
"<string>"
],
"domain": [
"<string>"
],
"device_type": [
"<string>"
],
"browser": [
"<string>"
],
"platform": [
"<string>"
],
"user_agent": [
"<string>"
],
"country": [
"<string>"
],
"region": [
"<string>"
]
},
"not_match": {
"client_id": [
"<string>"
],
"connection": [
"<string>"
],
"connection_type": [
"<string>"
],
"organization_id": [
"<string>"
],
"domain": [
"<string>"
],
"device_type": [
"<string>"
],
"browser": [
"<string>"
],
"platform": [
"<string>"
],
"user_agent": [
"<string>"
],
"country": [
"<string>"
],
"region": [
"<string>"
]
}
}
]
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
rules: [
{
match: {
client_id: ['<string>'],
connection: ['<string>'],
connection_type: ['<string>'],
organization_id: ['<string>'],
domain: ['<string>'],
device_type: ['<string>'],
browser: ['<string>'],
platform: ['<string>'],
user_agent: ['<string>'],
country: ['<string>'],
region: ['<string>']
},
not_match: {
client_id: ['<string>'],
connection: ['<string>'],
connection_type: ['<string>'],
organization_id: ['<string>'],
domain: ['<string>'],
device_type: ['<string>'],
browser: ['<string>'],
platform: ['<string>'],
user_agent: ['<string>'],
country: ['<string>'],
region: ['<string>']
}
}
]
})
};
fetch('https://{tenantDomain}/api/v2/experimentation/segments/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{tenantDomain}/api/v2/experimentation/segments/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"rules\": [\n {\n \"match\": {\n \"client_id\": [\n \"<string>\"\n ],\n \"connection\": [\n \"<string>\"\n ],\n \"connection_type\": [\n \"<string>\"\n ],\n \"organization_id\": [\n \"<string>\"\n ],\n \"domain\": [\n \"<string>\"\n ],\n \"device_type\": [\n \"<string>\"\n ],\n \"browser\": [\n \"<string>\"\n ],\n \"platform\": [\n \"<string>\"\n ],\n \"user_agent\": [\n \"<string>\"\n ],\n \"country\": [\n \"<string>\"\n ],\n \"region\": [\n \"<string>\"\n ]\n },\n \"not_match\": {\n \"client_id\": [\n \"<string>\"\n ],\n \"connection\": [\n \"<string>\"\n ],\n \"connection_type\": [\n \"<string>\"\n ],\n \"organization_id\": [\n \"<string>\"\n ],\n \"domain\": [\n \"<string>\"\n ],\n \"device_type\": [\n \"<string>\"\n ],\n \"browser\": [\n \"<string>\"\n ],\n \"platform\": [\n \"<string>\"\n ],\n \"user_agent\": [\n \"<string>\"\n ],\n \"country\": [\n \"<string>\"\n ],\n \"region\": [\n \"<string>\"\n ]\n }\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "<string>",
"name": "<string>",
"type": "self",
"status": "active",
"rules": [
{
"match": {
"client_id": [
"<string>"
],
"connection": [
"<string>"
],
"connection_type": [
"<string>"
],
"organization_id": [
"<string>"
],
"domain": [
"<string>"
],
"device_type": [
"<string>"
],
"browser": [
"<string>"
],
"platform": [
"<string>"
],
"user_agent": [
"<string>"
],
"country": [
"<string>"
],
"region": [
"<string>"
]
},
"not_match": {
"client_id": [
"<string>"
],
"connection": [
"<string>"
],
"connection_type": [
"<string>"
],
"organization_id": [
"<string>"
],
"domain": [
"<string>"
],
"device_type": [
"<string>"
],
"browser": [
"<string>"
],
"platform": [
"<string>"
],
"user_agent": [
"<string>"
],
"country": [
"<string>"
],
"region": [
"<string>"
]
}
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the segment to update.
Body
Partial update of a segment. Only provided fields are updated. Sending rules replaces the entire rules array.
A human-readable name for the segment
3 - 255^(?!.*\x00)\S(.*\S)?$A description of the segment
3 - 1024^(?!.*\x00)\S(.*\S)?$Replaces the entire rules array. Each rule is limited to 4KB and the whole segment to 10KB (serialized).
1Show child attributes
Show child attributes
Target lifecycle status. Archiving removes the segment from the active pool and is terminal (an archived segment cannot return to active). When combined with field edits, the edits apply first and the transition follows.
active, archived Response
Segment successfully updated.
^seg_[A-HJ-NP-Za-km-z1-9]+$self, auth0 active, archived Show child attributes
Show child attributes