Skip to content
Engine API

Mapping Sets

Mapping Sets endpoints of the MedHook engine API: 5 operations with parameters, schemas and a curl example for each.

On this page

Saved field mappings for a workflow.

List mapping sets

get/api/mapping-sets

Mapping sets in the caller's workspace. Rate limited to 30 requests per minute.

Minimum role: viewer.

Auth: Bearer token (how to get one) · Operation: listMappingSets

Parameters

NameInTypeDescription
workflowIdquerystring

Only the sets of this workflow.

Responses

  • 200The sets.
    Response fields

    application/json · object

  • 401No credential, or the token is invalid or expired.

    application/json · ApiError

  • 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/mapping-sets" \
  -H "Authorization: Bearer $TOKEN"

Create a mapping set

post/api/mapping-sets

Saves field mappings for a workflow, by hand or from an AI suggestion. Rate limited to 20 requests per minute.

Minimum role: operator.

Auth: Bearer token (how to get one) · Operation: createMappingSet

Request body (required)

application/json · object

  • workflowIdstringrequired
  • namestringrequired
  • sourceFormatstringrequired
  • targetFormatstringrequired
  • mappingsarray of objectrequired
  • sampleDataany
  • aiGeneratedboolean

Responses

  • 201Created.
    Response fields

    application/json · object

  • 400The request is malformed or fails validation.

    application/json · ApiError

  • 401No credential, or the token is invalid or expired.

    application/json · ApiError

  • 404Not found in the caller's workspace.

    application/json · ApiError

  • 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl -X POST "$ENGINE_URL/api/mapping-sets" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "workflowId": "string",
  "name": "string",
  "sourceFormat": "string",
  "targetFormat": "string",
  "mappings": [
    {}
  ],
  "sampleData": null,
  "aiGenerated": true
}'

Get a mapping set

get/api/mapping-sets/{id}

One mapping set. Returns 404 for a set in another workspace.

Minimum role: viewer.

Auth: Bearer token (how to get one) · Operation: getMappingSet

Parameters

NameInTypeDescription
idrequiredpathstring

Mapping set id.

Responses

  • 200The set.
    Response fields

    application/json · object

  • 401No credential, or the token is invalid or expired.

    application/json · ApiError

  • 404Not found in the caller's workspace.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/mapping-sets/<id>" \
  -H "Authorization: Bearer $TOKEN"

Update a mapping set

put/api/mapping-sets/{id}

Changes any of name, sourceFormat, targetFormat, mappings and sampleData. Fields you leave out keep their value. Rate limited to 20 requests per minute.

Minimum role: operator.

Auth: Bearer token (how to get one) · Operation: updateMappingSet

Parameters

NameInTypeDescription
idrequiredpathstring

Mapping set id.

Request body (required)

application/json · object

  • namestring
  • sourceFormatstring
  • targetFormatstring
  • mappingsarray of object
  • sampleDataany

Responses

  • 200Updated.
    Response fields

    application/json · object

  • 401No credential, or the token is invalid or expired.

    application/json · ApiError

  • 404Not found in the caller's workspace.

    application/json · ApiError

  • 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl -X PUT "$ENGINE_URL/api/mapping-sets/<id>" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "string",
  "sourceFormat": "string",
  "targetFormat": "string",
  "mappings": [
    {}
  ],
  "sampleData": null
}'

Delete a mapping set

delete/api/mapping-sets/{id}

Deletes the set. Rate limited to 5 requests per minute.

Minimum role: operator.

Auth: Bearer token (how to get one) · Operation: deleteMappingSet

Parameters

NameInTypeDescription
idrequiredpathstring

Mapping set id.

Responses

  • 200Deleted.
    Response fields

    application/json · object

    • successboolean
    • deletedAtstring (date-time)
  • 401No credential, or the token is invalid or expired.

    application/json · ApiError

  • 404Not found in the caller's workspace.

    application/json · ApiError

  • 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl -X DELETE "$ENGINE_URL/api/mapping-sets/<id>" \
  -H "Authorization: Bearer $TOKEN"

Schemas

Named objects the operations above link to.

ApiError

The error body. error is always present. code is present on most errors and is the field to branch on; a few routes and the sign-in and role checks return only error (and sometimes detail).

  • errorstringrequired

    Human-readable error message.

  • codestring

    Machine-readable error code.

    One of: "BAD_REQUEST", "INVALID_REQUEST", "UNAUTHORIZED", "UNAUTHENTICATED", "FORBIDDEN", "NOT_FOUND", "CONFLICT", "UNPROCESSABLE_ENTITY", "RATE_LIMITED", "INTERNAL_ERROR", "SERVICE_UNAVAILABLE", "NOT_CONFIGURED", "SIGNATURE_REQUIRED", "INVALID_SIGNATURE", "TIMESTAMP_REQUIRED", "TIMESTAMP_INVALID", "TIMESTAMP_OUT_OF_TOLERANCE", "INVALID_CREDENTIALS", "INVALID_TOKEN", "PAYLOAD_TOO_LARGE", "INVALID_NDJSON", "PHI_NOT_AUTHORIZED", "PHI_IN_SANDBOX", "IN_PROGRESS", "RETRY_SCHEDULED", "WORKFLOW_DISABLED", "CONFLICTING_SCOPE", "ALREADY_DELIVERED", "CHAIN_TOO_DEEP", "NO_FAILED_DESTINATION", "STALE_SCOPE", "UNKNOWN_DESTINATION", "NO_DESTINATIONS", "NOT_A_MESSAGE", "AI_FEATURES_DISABLED"

  • detailsany

    Optional structured context about the error.

MappingSet

  • idstring
  • workflowIdstring
  • namestring
  • sourceFormatstring
  • targetFormatstring
  • mappingsarray of object

    The field mappings.

  • sampleDataany | null

    Sample input used to build the mappings.

  • aiGeneratedboolean