---
title: "Preview of Translation Rules"
method: POST
path: "/api/v2/activedirectories/translation-rules/preview"
tags: ["Translation Rules", "Active Directory"]
---

# Preview of Translation Rules

`POST /api/v2/activedirectories/translation-rules/preview`

## Request

- Base URL: `https://console.jumpcloud.com`
- URL: `https://console.jumpcloud.com/api/v2/activedirectories/translation-rules/preview`
- Auth: API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/jumpcloud/apis/jumpcloud-console-api/docs/api/v2/activedirectories/translation-rules/preview/post.ts> (a function with typed inputs; its response is checked against the schema)

This endpoint previews the translation rules for a user.

#### Sample Request
```
curl -X POST '[https://console.jumpcloud.com/api/v2/activedirectories/](https://console.jumpcloud.com/api/v2/activedirectories/){activedirectory_id}/translationrules/preview' \
  -H 'accept: application/json' \
  -H 'content-type: application/json' \
  -H 'x-api-key: {API_KEY}' \
  -H 'x-org-id: {ORG_ID}' \
  -d '{
    "userObjectId": "{USER_ID_HEX}",
    "idmTranslationRules": [
      {
        "source": "department",
        "destination": "customDepartment",
        "sourceType": "PATH",
        "direction": "IMPORT",
        "appliedOn": [
          "CREATE"
        ]
      }
    ]
  }'
```

## Headers

- `x-org-id` string

## Request body

- ActiveDirectoriesTranslationRulesPreviewRequest: Request to preview the result of applying a set of translation rules to a user's data.
  - `translationRules` JumpcloudIdmTranslationRule[], required: A list of translation rules to apply for the preview.
    - `appliedOn` JumpcloudIdmAppliedOn[]: Operations when this translation rule is applied (CREATE, UPDATE)
    - `default` boolean: Indicates if this is a default translation rule created by jumpcloud
    - `destination` string: Destination field path where translated value will be stored
    - `direction` 'UNSPECIFIED' | 'EXPORT' | 'IMPORT': Direction defines the direction of the attribute mapping.
    - `editable` boolean: Indicates if this translation rule can be modified
    - `id` string, byte: Unique identifier for the translation rule
    - `required` boolean: Indicates if this translation is required
    - `source` string: Source field path or expression to be translated
    - `sourceType` 'PATH' | 'GOLANG_TEMPLATE' | 'CONSTANT' | 'EXPR' | 'ENUMERATION': SourceType defines the type of the source field in attribute mapping.
  - `userObjectId` string, hex, required: The unique identifier (Object ID) of the user whose data will be translated.
  - `activeDirectoryId` string, hex: The ObjectID of the Active Directory instance. Optional parameter to specify which Active Directory instance to use for the preview.

## Response `200`

Result of the preview operation.

- ActiveDirectoriesTranslationRulesPreviewResponse: The result of a translation rule preview, showing the original and translated user data.
  - `destinationUser` string: The user data after the translation rules have been applied. This represents the final state in the destination system (e.g., JumpCloud).
  - `sourceUser` string: The original user data from the source system (e.g., Active Directory) before any translation rules were applied.

## Other responses

- `default`: Error response

---

[API](https://skmtc.dev/jumpcloud/apis/jumpcloud-console-api.md) - [All operations](https://skmtc.dev/jumpcloud/apis/jumpcloud-console-api/llms.txt) - [OpenAPI document](https://skmtc.dev/jumpcloud/apis/jumpcloud-console-api/revisions/f396d9271b46?raw)
