Choose a consumer's capabilities and modes
curl --request PUT \
--url https://api.chift.eu/consumers/{consumer_id}/syncs/{syncid}/capabilities \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"selected": [
"spend_to_accounting.SupplierInvoices"
],
"modes": {
"spend_to_accounting.SupplierInvoices": "spend_to_accounting.SupplierInvoices.AsJournalEntry"
},
"answers": {
"spend_to_accounting.SyncAnalytics": true
},
"preflight": false
}
'import requests
url = "https://api.chift.eu/consumers/{consumer_id}/syncs/{syncid}/capabilities"
payload = {
"selected": ["spend_to_accounting.SupplierInvoices"],
"modes": { "spend_to_accounting.SupplierInvoices": "spend_to_accounting.SupplierInvoices.AsJournalEntry" },
"answers": { "spend_to_accounting.SyncAnalytics": True },
"preflight": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
selected: ['spend_to_accounting.SupplierInvoices'],
modes: {
'spend_to_accounting.SupplierInvoices': 'spend_to_accounting.SupplierInvoices.AsJournalEntry'
},
answers: {'spend_to_accounting.SyncAnalytics': true},
preflight: false
})
};
fetch('https://api.chift.eu/consumers/{consumer_id}/syncs/{syncid}/capabilities', 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.chift.eu/consumers/{consumer_id}/syncs/{syncid}/capabilities",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'selected' => [
'spend_to_accounting.SupplierInvoices'
],
'modes' => [
'spend_to_accounting.SupplierInvoices' => 'spend_to_accounting.SupplierInvoices.AsJournalEntry'
],
'answers' => [
'spend_to_accounting.SyncAnalytics' => true
],
'preflight' => false
]),
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.chift.eu/consumers/{consumer_id}/syncs/{syncid}/capabilities"
payload := strings.NewReader("{\n \"selected\": [\n \"spend_to_accounting.SupplierInvoices\"\n ],\n \"modes\": {\n \"spend_to_accounting.SupplierInvoices\": \"spend_to_accounting.SupplierInvoices.AsJournalEntry\"\n },\n \"answers\": {\n \"spend_to_accounting.SyncAnalytics\": true\n },\n \"preflight\": false\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.chift.eu/consumers/{consumer_id}/syncs/{syncid}/capabilities")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"selected\": [\n \"spend_to_accounting.SupplierInvoices\"\n ],\n \"modes\": {\n \"spend_to_accounting.SupplierInvoices\": \"spend_to_accounting.SupplierInvoices.AsJournalEntry\"\n },\n \"answers\": {\n \"spend_to_accounting.SyncAnalytics\": true\n },\n \"preflight\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chift.eu/consumers/{consumer_id}/syncs/{syncid}/capabilities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"selected\": [\n \"spend_to_accounting.SupplierInvoices\"\n ],\n \"modes\": {\n \"spend_to_accounting.SupplierInvoices\": \"spend_to_accounting.SupplierInvoices.AsJournalEntry\"\n },\n \"answers\": {\n \"spend_to_accounting.SyncAnalytics\": true\n },\n \"preflight\": false\n}"
response = http.request(request)
puts response.read_body{
"flowid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"enabled": true,
"capabilities": [
{
"key": "spend_to_accounting.SupplierInvoices",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"description": "<string>",
"kind": "main",
"source": "spend_management",
"target": "accounting",
"selected": true,
"effective": true,
"auto_enabled_by": [
"<string>"
],
"requires": [
"<string>"
],
"parent": "spend_to_accounting.CardPurchases",
"shown": true,
"available": true,
"reason_key": "<string>",
"reason": "<string>",
"mode": "<string>",
"chooses_mode": true,
"awaits_mode": true,
"default_mode": "spend_to_accounting.SupplierInvoices.AsInvoice",
"modes": [
{
"key": "spend_to_accounting.SupplierInvoices.AsInvoice",
"title": "<string>",
"description": "<string>",
"available": true,
"reason_key": "<string>",
"reason": "<string>",
"requires": [
"<string>"
],
"requires_modes": [
{
"capability": "spend_to_accounting.SupplierInvoices",
"mode": "spend_to_accounting.SupplierInvoices.AsInvoice"
}
]
}
]
}
],
"mappings": [
{
"key": "spend_to_accounting.PurchaseVatCodes",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"description": "<string>",
"used_by": [
"<string>"
],
"rows": [
"<string>"
]
}
],
"questions": [
{
"key": "spend_to_accounting.ExpensesSince",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"description": "<string>",
"used_by": [
"<string>"
],
"required": true,
"field": {
"key": "<string>",
"type": "date",
"group": "period",
"title": "<string>",
"tooltip": "<string>",
"default": "<unknown>",
"options": [],
"supported": true,
"unsupported_reason": "<string>"
},
"answer": "<unknown>"
}
],
"completeness": {
"missing_connections": [
{
"key": "<string>",
"title": "<string>"
}
],
"missing_questions": [
{
"key": "<string>",
"title": "<string>"
}
],
"missing_mappings": [
{
"key": "<string>",
"title": "<string>"
}
],
"missing_modes": [
{
"key": "<string>",
"title": "<string>"
}
]
},
"connections": [
{
"vertical": "accounting",
"title": "<string>",
"state": "connected",
"integration_id": "<string>",
"integration_ids": [
"<string>"
],
"integration_name": "NetSuite"
}
],
"latest_preview_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"changes": {
"enabled": [
"<string>"
],
"disabled": [
"<string>"
],
"mappings_added": [
"<string>"
],
"mappings_no_longer_needed": [
"<string>"
]
}
}Agentic syncs
Choose a consumer's capabilities and modes
Replaces the consumer’s choice of main capabilities and modes, and answers the questions given in answers. Whatever they need is turned on automatically. Answers with the resulting setup and what changed. The values of mappings no longer needed are kept. Send preflight: true to get that answer without saving anything.
PUT
/
consumers
/
{consumer_id}
/
syncs
/
{syncid}
/
capabilities
Choose a consumer's capabilities and modes
curl --request PUT \
--url https://api.chift.eu/consumers/{consumer_id}/syncs/{syncid}/capabilities \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"selected": [
"spend_to_accounting.SupplierInvoices"
],
"modes": {
"spend_to_accounting.SupplierInvoices": "spend_to_accounting.SupplierInvoices.AsJournalEntry"
},
"answers": {
"spend_to_accounting.SyncAnalytics": true
},
"preflight": false
}
'import requests
url = "https://api.chift.eu/consumers/{consumer_id}/syncs/{syncid}/capabilities"
payload = {
"selected": ["spend_to_accounting.SupplierInvoices"],
"modes": { "spend_to_accounting.SupplierInvoices": "spend_to_accounting.SupplierInvoices.AsJournalEntry" },
"answers": { "spend_to_accounting.SyncAnalytics": True },
"preflight": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
selected: ['spend_to_accounting.SupplierInvoices'],
modes: {
'spend_to_accounting.SupplierInvoices': 'spend_to_accounting.SupplierInvoices.AsJournalEntry'
},
answers: {'spend_to_accounting.SyncAnalytics': true},
preflight: false
})
};
fetch('https://api.chift.eu/consumers/{consumer_id}/syncs/{syncid}/capabilities', 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.chift.eu/consumers/{consumer_id}/syncs/{syncid}/capabilities",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'selected' => [
'spend_to_accounting.SupplierInvoices'
],
'modes' => [
'spend_to_accounting.SupplierInvoices' => 'spend_to_accounting.SupplierInvoices.AsJournalEntry'
],
'answers' => [
'spend_to_accounting.SyncAnalytics' => true
],
'preflight' => false
]),
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.chift.eu/consumers/{consumer_id}/syncs/{syncid}/capabilities"
payload := strings.NewReader("{\n \"selected\": [\n \"spend_to_accounting.SupplierInvoices\"\n ],\n \"modes\": {\n \"spend_to_accounting.SupplierInvoices\": \"spend_to_accounting.SupplierInvoices.AsJournalEntry\"\n },\n \"answers\": {\n \"spend_to_accounting.SyncAnalytics\": true\n },\n \"preflight\": false\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.chift.eu/consumers/{consumer_id}/syncs/{syncid}/capabilities")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"selected\": [\n \"spend_to_accounting.SupplierInvoices\"\n ],\n \"modes\": {\n \"spend_to_accounting.SupplierInvoices\": \"spend_to_accounting.SupplierInvoices.AsJournalEntry\"\n },\n \"answers\": {\n \"spend_to_accounting.SyncAnalytics\": true\n },\n \"preflight\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chift.eu/consumers/{consumer_id}/syncs/{syncid}/capabilities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"selected\": [\n \"spend_to_accounting.SupplierInvoices\"\n ],\n \"modes\": {\n \"spend_to_accounting.SupplierInvoices\": \"spend_to_accounting.SupplierInvoices.AsJournalEntry\"\n },\n \"answers\": {\n \"spend_to_accounting.SyncAnalytics\": true\n },\n \"preflight\": false\n}"
response = http.request(request)
puts response.read_body{
"flowid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"enabled": true,
"capabilities": [
{
"key": "spend_to_accounting.SupplierInvoices",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"description": "<string>",
"kind": "main",
"source": "spend_management",
"target": "accounting",
"selected": true,
"effective": true,
"auto_enabled_by": [
"<string>"
],
"requires": [
"<string>"
],
"parent": "spend_to_accounting.CardPurchases",
"shown": true,
"available": true,
"reason_key": "<string>",
"reason": "<string>",
"mode": "<string>",
"chooses_mode": true,
"awaits_mode": true,
"default_mode": "spend_to_accounting.SupplierInvoices.AsInvoice",
"modes": [
{
"key": "spend_to_accounting.SupplierInvoices.AsInvoice",
"title": "<string>",
"description": "<string>",
"available": true,
"reason_key": "<string>",
"reason": "<string>",
"requires": [
"<string>"
],
"requires_modes": [
{
"capability": "spend_to_accounting.SupplierInvoices",
"mode": "spend_to_accounting.SupplierInvoices.AsInvoice"
}
]
}
]
}
],
"mappings": [
{
"key": "spend_to_accounting.PurchaseVatCodes",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"description": "<string>",
"used_by": [
"<string>"
],
"rows": [
"<string>"
]
}
],
"questions": [
{
"key": "spend_to_accounting.ExpensesSince",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"description": "<string>",
"used_by": [
"<string>"
],
"required": true,
"field": {
"key": "<string>",
"type": "date",
"group": "period",
"title": "<string>",
"tooltip": "<string>",
"default": "<unknown>",
"options": [],
"supported": true,
"unsupported_reason": "<string>"
},
"answer": "<unknown>"
}
],
"completeness": {
"missing_connections": [
{
"key": "<string>",
"title": "<string>"
}
],
"missing_questions": [
{
"key": "<string>",
"title": "<string>"
}
],
"missing_mappings": [
{
"key": "<string>",
"title": "<string>"
}
],
"missing_modes": [
{
"key": "<string>",
"title": "<string>"
}
]
},
"connections": [
{
"vertical": "accounting",
"title": "<string>",
"state": "connected",
"integration_id": "<string>",
"integration_ids": [
"<string>"
],
"integration_name": "NetSuite"
}
],
"latest_preview_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"changes": {
"enabled": [
"<string>"
],
"disabled": [
"<string>"
],
"mappings_added": [
"<string>"
],
"mappings_no_longer_needed": [
"<string>"
]
}
}Authorizations
Query Parameters
Body
application/json
Question key -> answer, for the questions the capabilities chosen ask, as PATCH …/questions takes them. Only the questions given change; the answers to questions of the sync the new choice does not ask are ignored, so a screen can send its whole state; a question the sync never asks is refused.
Example:
{ "spend_to_accounting.SyncAnalytics": true }
Response
Successful Response