Skip to main content
POST
/
api
/
end_users
/
{end_user_id_or_heron_id}
/
bulk_category_feedback
Bulk create category feedback for an end user
curl --request POST \
  --url https://app.herondata.io/api/end_users/{end_user_id_or_heron_id}/bulk_category_feedback \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "category": {
    "heron_id": "ctg_KGMGYqcERfUCsP5QSwTvPA",
    "label": "Insurance"
  },
  "source": "<string>",
  "transaction_heron_ids": [],
  "transaction_reference_ids": []
}
'
import requests

url = "https://app.herondata.io/api/end_users/{end_user_id_or_heron_id}/bulk_category_feedback"

payload = {
"category": {
"heron_id": "ctg_KGMGYqcERfUCsP5QSwTvPA",
"label": "Insurance"
},
"source": "<string>",
"transaction_heron_ids": [],
"transaction_reference_ids": []
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
category: {heron_id: 'ctg_KGMGYqcERfUCsP5QSwTvPA', label: 'Insurance'},
source: '<string>',
transaction_heron_ids: [],
transaction_reference_ids: []
})
};

fetch('https://app.herondata.io/api/end_users/{end_user_id_or_heron_id}/bulk_category_feedback', 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://app.herondata.io/api/end_users/{end_user_id_or_heron_id}/bulk_category_feedback",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'category' => [
'heron_id' => 'ctg_KGMGYqcERfUCsP5QSwTvPA',
'label' => 'Insurance'
],
'source' => '<string>',
'transaction_heron_ids' => [

],
'transaction_reference_ids' => [

]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);

$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://app.herondata.io/api/end_users/{end_user_id_or_heron_id}/bulk_category_feedback"

payload := strings.NewReader("{\n \"category\": {\n \"heron_id\": \"ctg_KGMGYqcERfUCsP5QSwTvPA\",\n \"label\": \"Insurance\"\n },\n \"source\": \"<string>\",\n \"transaction_heron_ids\": [],\n \"transaction_reference_ids\": []\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("x-api-key", "<api-key>")
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.post("https://app.herondata.io/api/end_users/{end_user_id_or_heron_id}/bulk_category_feedback")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"category\": {\n \"heron_id\": \"ctg_KGMGYqcERfUCsP5QSwTvPA\",\n \"label\": \"Insurance\"\n },\n \"source\": \"<string>\",\n \"transaction_heron_ids\": [],\n \"transaction_reference_ids\": []\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://app.herondata.io/api/end_users/{end_user_id_or_heron_id}/bulk_category_feedback")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"category\": {\n \"heron_id\": \"ctg_KGMGYqcERfUCsP5QSwTvPA\",\n \"label\": \"Insurance\"\n },\n \"source\": \"<string>\",\n \"transaction_heron_ids\": [],\n \"transaction_reference_ids\": []\n}"

response = http.request(request)
puts response.read_body
{
  "category": {
    "description": "<string>",
    "heron_id": "<string>",
    "label": "<string>"
  },
  "num_annotations": 1,
  "transaction_heron_ids": [
    "<string>"
  ]
}

Authorizations

x-api-key
string
header
required

Path Parameters

end_user_id_or_heron_id
string
required

Query Parameters

high_priority
boolean
default:false

Whether to process the feedback with high priority

Body

application/json

A list of objects containing a Transaction's heron id and the suggested Category. If you provide a heron_id for Category, you don't need to provide other fields. If heron_id is provided, we disregard label.

category
object
required
source
string | null

your identifier for where the feedback comes from e.g. bob_the_underwriter

Maximum string length: 120
transaction_heron_ids
string[]

List of transaction heron IDs

transaction_reference_ids
string[]

List of transaction reference IDs

Response

201 - application/json

OK

category
object

The applied category

num_annotations
integer

The number of category annotations added

Example:

1

transaction_heron_ids
string[]

List of affected transaction heron IDs