List import templates
curl --request POST \
--url 'https://clarus-api.com/graphql#ListImportTemplates' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"query": "query($filter: ImportTemplateFilterType) { import_templates { all(filter: $filter) { edges { node { id file_regexp template_type account { id code } ftp_user { id name } mapping_group { id } } } } } }"
}
'import requests
url = "https://clarus-api.com/graphql#ListImportTemplates"
payload = { "query": "query($filter: ImportTemplateFilterType) { import_templates { all(filter: $filter) { edges { node { id file_regexp template_type account { id code } ftp_user { id name } mapping_group { id } } } } } }" }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
query: 'query($filter: ImportTemplateFilterType) { import_templates { all(filter: $filter) { edges { node { id file_regexp template_type account { id code } ftp_user { id name } mapping_group { id } } } } } }'
})
};
fetch('https://clarus-api.com/graphql#ListImportTemplates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"import_templates": {
"all": {
"edges": [
{
"node": {
"id": "45",
"file_regexp": "^ORDERS_.*\\.csv$",
"template_type": "StandardOrder",
"account": {
"id": "3",
"code": "ACME"
},
"ftp_user": {
"id": "12",
"name": "Acme Inbound Feed"
},
"mapping_group": {
"id": "45"
}
}
}
]
}
}
}
}{
"error": "<string>"
}Import Templates
List import templates
Retrieve import templates using GraphQL. Supports filtering, sorting, and pagination via relay-style connections.
POST
/
graphql#ListImportTemplates
List import templates
curl --request POST \
--url 'https://clarus-api.com/graphql#ListImportTemplates' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"query": "query($filter: ImportTemplateFilterType) { import_templates { all(filter: $filter) { edges { node { id file_regexp template_type account { id code } ftp_user { id name } mapping_group { id } } } } } }"
}
'import requests
url = "https://clarus-api.com/graphql#ListImportTemplates"
payload = { "query": "query($filter: ImportTemplateFilterType) { import_templates { all(filter: $filter) { edges { node { id file_regexp template_type account { id code } ftp_user { id name } mapping_group { id } } } } } }" }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
query: 'query($filter: ImportTemplateFilterType) { import_templates { all(filter: $filter) { edges { node { id file_regexp template_type account { id code } ftp_user { id name } mapping_group { id } } } } } }'
})
};
fetch('https://clarus-api.com/graphql#ListImportTemplates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"import_templates": {
"all": {
"edges": [
{
"node": {
"id": "45",
"file_regexp": "^ORDERS_.*\\.csv$",
"template_type": "StandardOrder",
"account": {
"id": "3",
"code": "ACME"
},
"ftp_user": {
"id": "12",
"name": "Acme Inbound Feed"
},
"mapping_group": {
"id": "45"
}
}
}
]
}
}
}
}{
"error": "<string>"
}Query Structure
query($filter: ImportTemplateFilterType) {
import_templates {
all(filter: $filter) {
edges {
node {
id
file_regexp
template_type
account { id code }
ftp_user { id name }
mapping_group { id }
}
}
}
}
}
Filter Argument
All filters are passed inside thefilter argument. Each filter field accepts an input object with operators (e.g. eq, ilike, from, to, between):
{
"filter": {
"template_type": {
"eq": "value"
}
}
}
Available Filters
| Filter | Input Type | Operators | Description |
|---|---|---|---|
template_type | ImportTemplatesTemplateTypeInputType | eq, in | Template type (enum input — e.g. StandardOrder) |
file_regexp | StringInputType | eq, ilike, like, in, between | Filename-matching regexp |
account_id | IdInputType | eq, in, gt, gteq, lt, lteq, filled | Stock account ID |
account_code | StringInputType | eq, ilike, like, in, between | Stock account code |
ftp_user_id | IdInputType | eq, in, gt, gteq, lt, lteq, filled | SFTP user ID |
ftp_user_name | StringInputType | eq, ilike, like, in, between | SFTP user name |
mapping_group_id | IdInputType | eq, in, gt, gteq, lt, lteq, filled | Mapping group ID |
created_at | DatetimeInputType | eq, from, to, between | Creation timestamp |
Authorizations
OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.
FlowAuthorization Code
- Authorization URL
- https://clarus-api.com/oauth/authorize
- Token URL
- https://clarus-api.com/oauth/token
FlowClient Credentials
- Token URL
- https://clarus-api.com/oauth/token
The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.
Body
application/json
GraphQL query string
Example:
"query($filter: ImportTemplateFilterType) { import_templates { all(filter: $filter) { edges { node { id file_regexp template_type account { id code } ftp_user { id name } mapping_group { id } } } } } }"
Query variables including the filter object
Show child attributes
Show child attributes
Example:
{
"filter": {
"template_type": { "eq": "StandardOrder" }
}
}

