Create Import Mapping
POST /importMappings
/importMappingsRequired Tokens
| Field | Type | Required | Description |
|---|---|---|---|
| Bearer | Authorization: Bearer <api-key> | Optional | Your API key. Pass it as the Bearer token on every request. |
| Event token | x-Event-Token | Optional | Run **Get Tokens** in the Authorization folder. Required for the `proposalLineItems` target. |
| Organization token | x-Organization-Token | Optional | Run **Get Tokens** in the **Organization API** collection, then set `orgToken` as a variable here. Required for the `events` target instead. |
Saves a column mapping for reuse. Stores it against the caller's organization, never against one event — so the mapping is available the next time the same file shape arrives, whichever event it lands on.
The permission is the target's — EventAdmin for proposalLineItems, OrganizationAdmin for
events.
Body
| Field | Type | Required | Description |
|---|---|---|---|
| target | string | Required | Matched case-insensitively; stored canonically. A mapping is target-specific and is never offered for another target. |
| name | string | Required | Non-empty. Names are not required to be unique. |
| configuration | string | Required | Non-empty. **Opaque to this API** — stored and returned byte for byte, never parsed. The client owns the shape. |
| isDefault | bool | Optional | Setting it clears the flag from whichever mapping held it for this target and organization. |
What belongs in configuration
Not enforced here, but the shape the wizard writes:
{
"contextId": null,
"uniqueAttributeKey": "attr:0198...",
"columns": [
{ "fileColumn": "Ref", "attributeKey": "attr:0198...", "attributeLabel": "Client Ref" }
]
}
| Key | Why it is there |
|---|---|
contextId | The event type the mapping was built against, since event attributes are defined per type. null is legal. |
uniqueAttributeKey | Saving the match key matters as much as saving the columns — re-picking it every month is the same friction. |
columns[].attributeKey | What resolution matches on. |
columns[].attributeLabel | A display snapshot, so a mapping that no longer resolves can still name the attribute it lost. Never used for matching. |
Exclusions and value overrides are deliberately not stored. Those are judgements about one file's contents; a mapping is about column shape, and next month's file has different rows.
Response
{ "id": "0198f2c1-..." }
The id is returned rather than a bare 201 so a client can select the mapping it just saved. Captured
into the importMappingId variable by this request's post-response script.
Only one default per target
The default is applied automatically when a file is uploaded for that target, so at most one can hold it. Setting it here clears the previous holder for the same target and organization; a default on a different target is untouched.
Errors
| Status | Meaning |
|---|---|
400 | target is not a registered import target, or name or configuration is empty. |
403 | The caller lacks the target's declared permission. |