Functional Roles
The /functional_roles endpoint provides read-only access to functional role definitions. Functional roles classify instance metadata fields by their purpose (e.g. keys, source fields, target fields) and define the structure of instance data for a pattern.
See Also
- Authentication — Required for all API requests
- Definition of Functional Roles — Configuring functional roles in patterns
- Instance Metadata — Guide to instance metadata concepts
- Patterns API — Pattern definitions
- Instance Properties API — Instance property schemas
GET /api/v1/functional_roles — Find Functional Roles
Retrieve a list of functional role definitions, optionally filtered by pattern.
Endpoint
GET https://app.metakraftwerk.com/api/v1/functional_rolesQuery Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
pattern | string | No | Filter by pattern name. |
pattern_id | integer | No | Filter by pattern ID. |
INFO
Only non-deleted functional roles are returned.
Response Schema
Returns an array of functional role objects:
| Field | Type | Description |
|---|---|---|
id | integer | Unique functional role ID. |
pattern_id | integer | Associated pattern ID. |
name | string | Functional role name (e.g. SRC_AND_TGT_FIELD, SK, BK). |
class | string | Role class (if applicable). |
domain | string | Role domain (if applicable). |
cardinality_min | string | Minimum cardinality (0, 1, etc.). |
cardinality_max | string | Maximum cardinality (1, N, etc.). |
pos_no | integer | Display position number. |
deleted | boolean | Whether the role is marked as deleted. |
disabled | boolean | Whether the role is disabled. |
readonly | boolean | Whether the role is read-only. |
merge_strategy | string | Merge strategy for release management (if applicable). |
Examples
cURL
bash
# Find by pattern name
curl -X GET "https://app.metakraftwerk.com/api/v1/functional_roles?pattern=CORE_DV_HLS" \
-H "Authorization: Bearer $ACCESS_TOKEN"
# Find by pattern ID
curl -X GET "https://app.metakraftwerk.com/api/v1/functional_roles?pattern_id=808" \
-H "Authorization: Bearer $ACCESS_TOKEN"JavaScript (Fetch)
javascript
const response = await fetch(
'https://app.metakraftwerk.com/api/v1/functional_roles?pattern=CORE_DV_HLS',
{ headers: { 'Authorization': `Bearer ${accessToken}` } }
);
const roles = await response.json();Response Example
json
[
{
"id": 3515,
"pattern_id": 808,
"name": "SRC_AND_TGT_FIELD",
"class": null,
"domain": null,
"cardinality_min": "0",
"cardinality_max": "N",
"pos_no": 6,
"deleted": false,
"disabled": false,
"readonly": false,
"merge_strategy": null
}
]Error Responses
| Status | Condition | Example Message |
|---|---|---|
401 | Missing or invalid token | Not authenticated |
404 | Pattern not found | A pattern with the name 'X' does not exist! |
GET /api/v1/functional_roles/:id — Get Functional Role
Retrieve a single functional role by its ID.
Endpoint
GET https://app.metakraftwerk.com/api/v1/functional_roles/:idPath Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | The functional role ID. |
Examples
cURL
bash
curl -X GET "https://app.metakraftwerk.com/api/v1/functional_roles/3515" \
-H "Authorization: Bearer $ACCESS_TOKEN"JavaScript (Fetch)
javascript
const response = await fetch(
'https://app.metakraftwerk.com/api/v1/functional_roles/3515',
{ headers: { 'Authorization': `Bearer ${accessToken}` } }
);
const role = await response.json();Error Responses
| Status | Condition | Example Message |
|---|---|---|
401 | Missing or invalid token | Not authenticated |
404 | Functional role not found | No record found for id 'X' |
POST /api/v1/functional_roles — Create
Not implemented
PUT /api/v1/functional_roles — Update
Not implemented
PATCH /api/v1/functional_roles/:id — Patch
Not implemented
DELETE /api/v1/functional_roles/:id — Remove
Not implemented