---
title: "Create Translation Rule"
method: POST
path: "/activedirectories/{activedirectory_id}/translation-rules"
tags: ["Translation Rules", "Active Directory"]
---

# Create Translation Rule

`POST /activedirectories/{activedirectory_id}/translation-rules`

## Request

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

This endpoint allows you to create a new translation rule for a given Active Directory domain instance.

#### Sample Request
```
curl -X POST '[https://console.jumpcloud.com/api/v2/activedirectories/](https://console.jumpcloud.com/api/v2/activedirectories/){activedirectory_id}/translationrules' \
  -H 'accept: application/json' \
  -H 'content-type: application/json' \
  -H 'x-api-key: {API_KEY}' \
  -H 'x-org-id: {ORG_ID}' \
  -d '{
    "organization_object_id": "{ORG_ID_BASE64}",
    "domain_object_id": "{AD_ID_BASE64}",
    "translation_rule": {
      "source": "department",
      "destination": "customDepartment",
      "source_type": "PATH",
      "direction": "EXPORT",
      "applied_on": [
        "CREATE",
        "UPDATE"
      ]
    }
  }'
```

## Headers

- `x-org-id` string

## Request body

- JumpcloudIdmIdmTranslationRulesInsertRequest
  - `appliedOn` JumpcloudIdmAppliedOn[]: Operations when this translation rule is applied (CREATE, UPDATE)
  - `destination` string: Destination field path where translated value will be stored
  - `direction` 'UNSPECIFIED' | 'EXPORT' | 'IMPORT': Direction defines the direction of the attribute mapping.
  - `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.

## Response `200`

The created translation rule's object ID.

- ActiveDirectoriesTranslationRulesInsertResponse
  - `translation_rule` JumpcloudIdmTranslationRule: TranslationRule proto message will only be used for responses.
    - `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.

## Other responses

- `default`: Error response

---

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