Set connector field mapping
Say what Corma writes into one field of the connector when it creates an account. This replaces whatever filled the field before, Corma's own default included. To restore that default, delete the mapping.
curl -X PUT "https://api.corma.io/v1/connectors/{id}/field-mappings/{targetFieldId}" \
-H "x-corma-api-key: $CORMA_OPEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"mode": "expression",
"expression": "string"
}'Authorization
x-corma-api-keystringheaderrequiredColon-separated API key ID and secret:
API_KEY_ID:API_KEY_SECRET
Parameters
idstringpathrequiredThe identifier of the connector, as
GET /connectorsreturned it, or the id of its connection. Thekind.methodform names the only connection of that integration; with several, it answers 409.targetFieldIdstringpathrequiredThe field of the connector, as
GET /connectors/{id}/field-mappingsreturned its identifier.x-corma-idempotency-keystringheaderOptional client-generated key. Reusing the same key with an identical request replays the original response instead of enqueueing a duplicate task.
Body
Response
OK
targetFieldIdstringrequiredThe field of the connector this mapping fills, as
GET /connectors/{id}/fieldsreturned its identifier.targetLabelstringrequiredThe name of the field, as Corma displays it.
typeenum<string>requiredThe type of value the field holds.
One of:stringnumberbooleandatestring[]object[]useroriginenum<string>requiredWhether the connector documents the field or the workspace defined it.
One of:standardcustomrequiredbooleanrequiredTrue when the connector needs this field to create an account. A required field cannot be switched off.
notestring | nullrequiredOne sentence about the field, to show beside it. Null when the label is sufficient.
expressionstring | nullrequiredThe expression that computes the value, as it was written. Its variables are rooted on
user. Null when Corma writes nothing into the field.skipEmptybooleanrequiredWhen true, an expression that resolves to nothing leaves the field out of the request Corma sends instead of writing an empty value.
sourceenum<string>requiredWhere the expression comes from.
One of:defaultcustomoffnone
{
"targetFieldId": "string",
"targetLabel": "string",
"type": "string",
"origin": "standard",
"required": true,
"note": "string",
"expression": "string",
"skipEmpty": true,
"source": "default"
}