Skip to main content
POST
/
api
/
v1
/
mappings
/
Create endpoint-to-action mapping
curl --request POST \
  --url https://services.pref.rio/heimdall-admin/api/v1/mappings/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "action_id": 1,
  "description": "Get user profile information",
  "method": "GET",
  "path_pattern": "/api/v1/users/{user_id}"
}'
{
  "id": 1,
  "path_pattern": "/api/v1/users/{user_id}",
  "method": "GET",
  "action": "user:read",
  "description": "Get user profile information",
  "created_by": "12345678901",
  "created_at": "2024-01-15T10:30:00Z"
}

Authorizations

Authorization
string
header
required

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

Body

application/json

Request model for creating a new endpoint-to-action mapping.

path_pattern
string
required

URL path pattern (supports wildcards and path parameters)

Required string length: 1 - 255
Example:

"/api/v1/users/{user_id}"

method
string
required

HTTP method

Example:

"GET"

action_id
integer
required

ID of the action to map to this endpoint

Required range: x > 0
Example:

1

description
string | null

Optional description of this mapping

Maximum length: 500
Example:

"Get user profile information"

Response

Mapping created successfully

Detailed response model for mapping information.

id
integer
required

Unique identifier of the mapping

Example:

1

path_pattern
string
required

URL path pattern

Example:

"/api/v1/users/{user_id}"

method
string
required

HTTP method

Example:

"GET"

action
string
required

Action name

Example:

"user:read"

created_at
string
required

ISO timestamp when the mapping was created

Example:

"2024-01-15T10:30:00Z"

description
string | null

Mapping description

Example:

"Get user profile information"

created_by
string | null

CPF of the user who created this mapping

Example:

"12345678901"

updated_at
string | null

ISO timestamp when the mapping was last updated

Example:

"2024-01-16T14:20:00Z"