curl --request PUT \
--url https://services.pref.rio/heimdall-admin/api/v1/mappings/{mapping_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "Get detailed user profile information",
"path_pattern": "/api/v1/users/{user_id}/profile"
}
'import requests
url = "https://services.pref.rio/heimdall-admin/api/v1/mappings/{mapping_id}"
payload = {
"description": "Get detailed user profile information",
"path_pattern": "/api/v1/users/{user_id}/profile"
}
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({
description: 'Get detailed user profile information',
path_pattern: '/api/v1/users/{user_id}/profile'
})
};
fetch('https://services.pref.rio/heimdall-admin/api/v1/mappings/{mapping_id}', 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://services.pref.rio/heimdall-admin/api/v1/mappings/{mapping_id}",
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([
'description' => 'Get detailed user profile information',
'path_pattern' => '/api/v1/users/{user_id}/profile'
]),
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://services.pref.rio/heimdall-admin/api/v1/mappings/{mapping_id}"
payload := strings.NewReader("{\n \"description\": \"Get detailed user profile information\",\n \"path_pattern\": \"/api/v1/users/{user_id}/profile\"\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://services.pref.rio/heimdall-admin/api/v1/mappings/{mapping_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Get detailed user profile information\",\n \"path_pattern\": \"/api/v1/users/{user_id}/profile\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://services.pref.rio/heimdall-admin/api/v1/mappings/{mapping_id}")
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 \"description\": \"Get detailed user profile information\",\n \"path_pattern\": \"/api/v1/users/{user_id}/profile\"\n}"
response = http.request(request)
puts response.read_body{
"id": 1,
"path_pattern": "/api/v1/users/{user_id}/profile",
"method": "GET",
"action": "user:read",
"description": "Get detailed user profile information",
"created_by": "12345678901",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-16T14:20:00Z"
}{
"detail": "Action with ID 999 does not exist"
}{
"detail": "Could not validate credentials"
}{
"detail": "Permission denied to update mapping 1"
}{
"detail": "Mapping with ID 999 not found"
}{
"detail": "Validation error",
"errors": [
{
"loc": [
"body",
"method"
],
"msg": "string does not match regex",
"type": "value_error.regex"
}
]
}{
"detail": "Failed to update mapping: Database connection error"
}Update endpoint mapping
Update an existing endpoint-to-action mapping.
Authorization: Requires admin privileges to update mappings.
Partial Updates: You can update individual fields (path_pattern, method, action_id, description) without affecting others. Provide only the fields you want to change.
Validation: The new path pattern and method combination must not conflict with existing mappings (unless it’s the same mapping being updated).
Action Reference: If updating action_id, the new action must exist.
Use Cases:
- Update endpoint patterns when API paths change
- Change the action associated with an endpoint
- Update descriptions for better documentation
- Administrative maintenance of authorization configuration
curl --request PUT \
--url https://services.pref.rio/heimdall-admin/api/v1/mappings/{mapping_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "Get detailed user profile information",
"path_pattern": "/api/v1/users/{user_id}/profile"
}
'import requests
url = "https://services.pref.rio/heimdall-admin/api/v1/mappings/{mapping_id}"
payload = {
"description": "Get detailed user profile information",
"path_pattern": "/api/v1/users/{user_id}/profile"
}
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({
description: 'Get detailed user profile information',
path_pattern: '/api/v1/users/{user_id}/profile'
})
};
fetch('https://services.pref.rio/heimdall-admin/api/v1/mappings/{mapping_id}', 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://services.pref.rio/heimdall-admin/api/v1/mappings/{mapping_id}",
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([
'description' => 'Get detailed user profile information',
'path_pattern' => '/api/v1/users/{user_id}/profile'
]),
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://services.pref.rio/heimdall-admin/api/v1/mappings/{mapping_id}"
payload := strings.NewReader("{\n \"description\": \"Get detailed user profile information\",\n \"path_pattern\": \"/api/v1/users/{user_id}/profile\"\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://services.pref.rio/heimdall-admin/api/v1/mappings/{mapping_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Get detailed user profile information\",\n \"path_pattern\": \"/api/v1/users/{user_id}/profile\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://services.pref.rio/heimdall-admin/api/v1/mappings/{mapping_id}")
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 \"description\": \"Get detailed user profile information\",\n \"path_pattern\": \"/api/v1/users/{user_id}/profile\"\n}"
response = http.request(request)
puts response.read_body{
"id": 1,
"path_pattern": "/api/v1/users/{user_id}/profile",
"method": "GET",
"action": "user:read",
"description": "Get detailed user profile information",
"created_by": "12345678901",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-16T14:20:00Z"
}{
"detail": "Action with ID 999 does not exist"
}{
"detail": "Could not validate credentials"
}{
"detail": "Permission denied to update mapping 1"
}{
"detail": "Mapping with ID 999 not found"
}{
"detail": "Validation error",
"errors": [
{
"loc": [
"body",
"method"
],
"msg": "string does not match regex",
"type": "value_error.regex"
}
]
}{
"detail": "Failed to update mapping: Database connection error"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
Request model for updating an existing endpoint-to-action mapping.
Updated URL path pattern
1 - 255"/api/v1/users/{user_id}"
Updated HTTP method
^(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS)$"GET"
Updated action ID
x > 02
Updated description
500"Get detailed user profile information"
Response
Mapping updated successfully
Detailed response model for mapping information.
Unique identifier of the mapping
1
URL path pattern
"/api/v1/users/{user_id}"
HTTP method
"GET"
Action name
"user:read"
ISO timestamp when the mapping was created
"2024-01-15T10:30:00Z"
Mapping description
"Get user profile information"
CPF of the user who created this mapping
"12345678901"
ISO timestamp when the mapping was last updated
"2024-01-16T14:20:00Z"
