Skip to content
Reference>REST API>/functional_roles

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

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_roles

Query Parameters

ParameterTypeRequiredDescription
patternstringNoFilter by pattern name.
pattern_idintegerNoFilter by pattern ID.

INFO

Only non-deleted functional roles are returned.

Response Schema

Returns an array of functional role objects:

FieldTypeDescription
idintegerUnique functional role ID.
pattern_idintegerAssociated pattern ID.
namestringFunctional role name (e.g. SRC_AND_TGT_FIELD, SK, BK).
classstringRole class (if applicable).
domainstringRole domain (if applicable).
cardinality_minstringMinimum cardinality (0, 1, etc.).
cardinality_maxstringMaximum cardinality (1, N, etc.).
pos_nointegerDisplay position number.
deletedbooleanWhether the role is marked as deleted.
disabledbooleanWhether the role is disabled.
readonlybooleanWhether the role is read-only.
merge_strategystringMerge 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

StatusConditionExample Message
401Missing or invalid tokenNot authenticated
404Pattern not foundA 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/:id

Path Parameters

ParameterTypeRequiredDescription
idintegerYesThe 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

StatusConditionExample Message
401Missing or invalid tokenNot authenticated
404Functional role not foundNo 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