Skip to main content
PUT
/
v1
/
governance
/
actor-mappings
/
{actorId}
Upsert an actor mapping
curl --request PUT \
  --url https://matcher.sandbox.lerian.net/v1/governance/actor-mappings/{actorId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "displayName": "John Doe",
  "email": "john.doe@company.com"
}
'
import requests

url = "https://matcher.sandbox.lerian.net/v1/governance/actor-mappings/{actorId}"

payload = {
"displayName": "John Doe",
"email": "john.doe@company.com"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({displayName: 'John Doe', email: 'john.doe@company.com'})
};

fetch('https://matcher.sandbox.lerian.net/v1/governance/actor-mappings/{actorId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://matcher.sandbox.lerian.net/v1/governance/actor-mappings/{actorId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'displayName' => 'John Doe',
'email' => 'john.doe@company.com'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://matcher.sandbox.lerian.net/v1/governance/actor-mappings/{actorId}"

payload := strings.NewReader("{\n \"displayName\": \"John Doe\",\n \"email\": \"john.doe@company.com\"\n}")

req, _ := http.NewRequest("PUT", 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))

}
HttpResponse<String> response = Unirest.put("https://matcher.sandbox.lerian.net/v1/governance/actor-mappings/{actorId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"displayName\": \"John Doe\",\n \"email\": \"john.doe@company.com\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://matcher.sandbox.lerian.net/v1/governance/actor-mappings/{actorId}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"displayName\": \"John Doe\",\n \"email\": \"john.doe@company.com\"\n}"

response = http.request(request)
puts response.read_body
{
  "actorId": "user-abc-123",
  "displayName": "John Doe",
  "email": "john.doe@company.com",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z"
}
{
"code": "MTCH-0001",
"title": "Bad Request",
"message": "context not found",
"error": "<string>",
"details": {}
}
{
"code": "MTCH-0001",
"title": "Bad Request",
"message": "context not found",
"error": "<string>",
"details": {}
}
{
"code": "MTCH-0001",
"title": "Bad Request",
"message": "context not found",
"error": "<string>",
"details": {}
}
{
"code": "MTCH-0002",
"title": "Internal Server Error",
"message": "internal server error"
}

Authorizations

Authorization
string
header
required

Bearer token authentication (format: "Bearer {token}")

Headers

X-Request-Id
string

A unique identifier for tracing the request across services.

X-Idempotency-Key
string

Optional idempotency key for safe retries. Also accepts Idempotency-Key as an alternative header name. If the same key is sent again and the original request was already processed, the cached response is returned with X-Idempotency-Replayed: true.

See Retries and idempotency for details.

Path Parameters

actorId
string
required

The actor identifier to map.

Body

application/json

Actor mapping payload

Request payload for creating or updating an actor mapping

displayName
string

Human-readable display name for the actor

Example:

"John Doe"

email
string<email>

Email address associated with the actor

Example:

"john.doe@company.com"

Response

Actor mapping created or updated.

The response includes the X-Idempotency-Replayed header.

If the value is false, the request was just processed. If the value is true, the response is a replay of a previously processed request.

See Retries and idempotency for more details.

An actor mapping associating a system identifier with display information

actorId
string

The actor identifier

Example:

"user-abc-123"

displayName
string

Human-readable display name

Example:

"John Doe"

email
string

Email address

Example:

"john.doe@company.com"

createdAt
string<date-time>

Timestamp when the mapping was created

updatedAt
string<date-time>

Timestamp when the mapping was last updated