Skip to main content
POST
/
v1
/
org
/
domain-mappings
Create Domain Mapping
curl --request POST \
  --url https://api.twine.se/v1/org/domain-mappings \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "from_domain": "employee",
  "source_system_integration_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
  "target_system_integration_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
  "to_domain": "employee",
  "conditions": [
    {
      "apply_on_actions": [
        "create"
      ],
      "condition": {},
      "domain": "employee",
      "enabled": true,
      "description": "<string>"
    }
  ],
  "enabled": true,
  "sync_triggers": [
    {
      "cron_expression": "0 0 * * *",
      "enabled": false,
      "parent_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b"
    }
  ]
}
'
{
  "data": {
    "enabled": true,
    "from_domain": "employee",
    "id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
    "org_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
    "source_system_integration_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
    "target_system_integration_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
    "to_domain": "employee",
    "conditions": [
      {
        "apply_on_actions": [
          "create"
        ],
        "condition": {},
        "domain": "employee",
        "enabled": true,
        "id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
        "description": "<string>"
      }
    ],
    "sync_triggers": [
      {
        "domain_mapping_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
        "id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
        "org_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
        "system_integration_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
        "cron_expression": "0 0 * * *",
        "domain_configuration": {
          "domain": "time_report",
          "from_date": "2023-12-25",
          "from_date_engine": {},
          "to_date": "2023-12-25",
          "to_date_engine": {}
        },
        "last_sync_ended_at": "2023-01-01T00:00:00Z",
        "last_sync_started_at": "2023-01-01T00:00:00Z",
        "next_sync_at": "2023-01-01T00:00:00Z",
        "parent_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b"
      }
    ]
  }
}

Authorizations

Authorization
string
header
required

Bearer token for authentication

Body

application/json

DomainMappingCreateRequest

Schema for creating a domain mapping

from_domain
enum<string>
required

The data domain

Available options:
transaction,
file_transfer,
project,
org_unit,
customer,
schedule,
time_report,
employee
Example:

"employee"

source_system_integration_id
string<uuid>
required

The UUID of the source system integration

Example:

"018eae56-8f9d-7ca0-bea3-17f3db6cf75b"

target_system_integration_id
string<uuid>
required

The UUID of the target system integration

Example:

"018eae56-8f9d-7ca0-bea3-17f3db6cf75b"

to_domain
enum<string>
required

The data domain

Available options:
transaction,
file_transfer,
project,
org_unit,
customer,
schedule,
time_report,
employee
Example:

"employee"

conditions
ConditionCreate · object[] | null

List of conditions to create and attach to the created domain mapping.

enabled
boolean | null
default:true

Whether the domain mapping is enabled. Defaults to true.

Example:

true

sync_triggers
SyncTriggerCreate · object[] | null

List of sync triggers to create and attach to the created domain mapping. NOTE: Currently only one sync trigger can be created while creating a domain mapping. If multiple sync triggers are specified, only the first will be used. This restriction will be lifted in the future.

Response

Domain Mapping Response

Response schema for a single domain mapping.

data
DomainMapping · object

An object representing a domain mapping.