Skip to main content
POST
/
api
/
import_templates
Create an import template
curl --request POST \
  --url https://clarus-api.com/api/import_templates \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-Clarus-Subdomain: <api-key>' \
  --data '
{
  "data": {
    "type": "import_templates",
    "attributes": {
      "file_regexp": "^ORDERS_.*\\.csv$",
      "template_type": "StandardOrder",
      "ftp_user_id": 12,
      "account_id": 3,
      "mapping_group_id": 45
    }
  }
}
'
{
  "data": {
    "id": "45",
    "type": "import_templates",
    "attributes": {
      "file_regexp": "^ORDERS_.*\\.csv$",
      "template_type": "StandardOrder",
      "user_id": 7
    }
  }
}

Request Structure

{
  "data": {
    "type": "import_templates",
    "attributes": {
      "file_regexp": "^ORDERS_.*\\.csv$",
      "template_type": "StandardOrder",
      "ftp_user_id": 12,
      "account_id": 3,
      "mapping_group_id": 45
    }
  }
}

Key Fields

FieldRequiredDescription
file_regexpYesRegexp matched against incoming filenames
ftp_user_idYesSFTP user whose uploads this template processes
template_typeNoOne of the supported template types (see enum)
account_idNoStock account the data belongs to
mapping_group_idNoMappingGroup (must have operation_type = ftp)

Authorizations

Authorization
string
header
required

OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.

X-Clarus-Subdomain
string
header
required

The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.

Body

application/json
data
object
required

Response

Created successfully

data
object