Transform data
curl --request POST \
--url https://api.structural.app/api/v1/transform \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {},
"context": {}
}
'import requests
url = "https://api.structural.app/api/v1/transform"
payload = {
"data": {},
"context": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({data: {}, context: {}})
};
fetch('https://api.structural.app/api/v1/transform', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.structural.app/api/v1/transform",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
],
'context' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.structural.app/api/v1/transform"
payload := strings.NewReader("{\n \"data\": {},\n \"context\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.structural.app/api/v1/transform")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {},\n \"context\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.structural.app/api/v1/transform")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {},\n \"context\": {}\n}"
response = http.request(request)
puts response.read_body{
"canonical": {},
"data": {},
"metadata": {
"source": "procore",
"target": "procore",
"entity_type": "<string>",
"canonical_version": "1.0",
"transformed_at": "2023-11-07T05:31:56Z",
"request_id": "req_a1b2c3d4e5f6",
"references": {
"resolved": [
{
"field": "<string>",
"canonical_id": "<string>",
"platform_id": "<string>",
"injected": true,
"reason": "<string>"
}
],
"unresolved": [
{
"field": "<string>",
"canonical_id": "<string>",
"reason": "<string>"
}
]
}
}
}{
"error": {
"type": "VALIDATION_ERROR",
"message": "Invalid input",
"request_id": "req_a1b2c3d4e5f6"
}
}{
"error": {
"type": "AUTHENTICATION_ERROR",
"message": "Invalid or missing API key",
"request_id": "req_a1b2c3d4e5f6"
}
}{
"error": {
"type": "TRANSFORM_ERROR",
"message": "Transform failed",
"request_id": "req_a1b2c3d4e5f6"
}
}API Reference
Transform data
Stateless translation: pass in platform data, get back the canonical form and the
target platform’s representation. Nothing is persisted. Use this to preview a
translation before committing with /propagate.
POST
/
transform
Transform data
curl --request POST \
--url https://api.structural.app/api/v1/transform \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {},
"context": {}
}
'import requests
url = "https://api.structural.app/api/v1/transform"
payload = {
"data": {},
"context": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({data: {}, context: {}})
};
fetch('https://api.structural.app/api/v1/transform', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.structural.app/api/v1/transform",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
],
'context' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.structural.app/api/v1/transform"
payload := strings.NewReader("{\n \"data\": {},\n \"context\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.structural.app/api/v1/transform")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {},\n \"context\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.structural.app/api/v1/transform")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {},\n \"context\": {}\n}"
response = http.request(request)
puts response.read_body{
"canonical": {},
"data": {},
"metadata": {
"source": "procore",
"target": "procore",
"entity_type": "<string>",
"canonical_version": "1.0",
"transformed_at": "2023-11-07T05:31:56Z",
"request_id": "req_a1b2c3d4e5f6",
"references": {
"resolved": [
{
"field": "<string>",
"canonical_id": "<string>",
"platform_id": "<string>",
"injected": true,
"reason": "<string>"
}
],
"unresolved": [
{
"field": "<string>",
"canonical_id": "<string>",
"reason": "<string>"
}
]
}
}
}{
"error": {
"type": "VALIDATION_ERROR",
"message": "Invalid input",
"request_id": "req_a1b2c3d4e5f6"
}
}{
"error": {
"type": "AUTHENTICATION_ERROR",
"message": "Invalid or missing API key",
"request_id": "req_a1b2c3d4e5f6"
}
}{
"error": {
"type": "TRANSFORM_ERROR",
"message": "Transform failed",
"request_id": "req_a1b2c3d4e5f6"
}
}The stateless translation primitive. Pass in platform data, get back the canonical form
and the target platform’s representation. Nothing is persisted - no database reads or
writes, no fan-out to connected platforms.
Use
Valid values for
/transform when you want to:
- Preview what a cross-platform translation looks like before committing with
POST /propagate - Validate your data shape against Structural’s canonical model
- Get both the canonical and target-platform views in a single call without side effects
Supported entity types
/transform accepts 9 entity types - more than /connect and /propagate (which
accept 5), because it does not require entity data to be seeded first:
project, customer, contract, invoice, payment, employee, time_entry,
change_order, budget_line_item
The context field
Some mappers require additional context that is not present in the source data itself. Thecontext field is an optional generic object (Record<string, unknown>) that passes
through to the mapper.
Procore contracts require context with a commitmentType key:
{
"source": "procore",
"target": "dynamics",
"entity_type": "contract",
"data": {
"id": 1945782,
"title": "Substructure Package",
"number": "C-LEX-001",
"status": "Approved",
"grand_total": "8500000.00",
"project": { "id": 341276, "name": "Lusail Boulevard Tower" },
"vendor": { "id": 501004, "company": "Doha Infrastructure Partners WLL" },
"description": "Raft foundation and basement levels",
"contract_start_date": "2025-11-01",
"contract_estimated_completion_date": "2026-06-30",
"currency_configuration": { "currency_iso_code": "USD" }
},
"context": {
"commitmentType": "WorkOrderContract"
}
}
commitmentType are "WorkOrderContract" and "PurchaseOrderContract".
Omitting context when transforming a Procore contract results in a 422 TRANSFORM_ERROR.
Dynamics contracts do not require context - the mapper handles them without additional
input.
Response
The response contains three sections:canonical- the platform-agnostic representation with typed IDs, money in minor units, and ISO currency codesdata- the target platform’s representation, ready to send to that platform’s APImetadata- source, target, entity type, canonical version, timestamp, and request ID. When cross-entity references were resolved (e.g., a payment referencing a project), areferencesobject reports which references were resolved and which could not be found
Authorizations
API key passed as a Bearer token. Keys are prefixed: sk_demo_* (sandbox),
sk_live_* (production), sk_test_* (staging).
Body
application/json
Source platform
Available options:
procore, dynamics Target platform
Available options:
procore, dynamics The entity type to transform. 9 types are supported. contract requires a
context field when source is procore.
Available options:
project, customer, employee, time_entry, invoice, payment, contract, change_order, budget_line_item The platform-native data to transform
Optional mapper context. For Procore contracts, pass
{"commitmentType": "WorkOrderContract"} or {"commitmentType": "PurchaseOrderContract"}.
Omitting this for Procore contracts results in a 422 error.