File a contact's past activities under its accounts
curl --request POST \
--url https://api.statisfy.com/v1/objects/contact/records/{contact_id}/refile-activities \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accounts": [
"0015g00000AbCdEAAV"
],
"window_days": 90
}
'import requests
url = "https://api.statisfy.com/v1/objects/contact/records/{contact_id}/refile-activities"
payload = {
"accounts": ["0015g00000AbCdEAAV"],
"window_days": 90
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({accounts: ['0015g00000AbCdEAAV'], window_days: 90})
};
fetch('https://api.statisfy.com/v1/objects/contact/records/{contact_id}/refile-activities', 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.statisfy.com/v1/objects/contact/records/{contact_id}/refile-activities",
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([
'accounts' => [
'0015g00000AbCdEAAV'
],
'window_days' => 90
]),
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.statisfy.com/v1/objects/contact/records/{contact_id}/refile-activities"
payload := strings.NewReader("{\n \"accounts\": [\n \"0015g00000AbCdEAAV\"\n ],\n \"window_days\": 90\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.statisfy.com/v1/objects/contact/records/{contact_id}/refile-activities")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accounts\": [\n \"0015g00000AbCdEAAV\"\n ],\n \"window_days\": 90\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.statisfy.com/v1/objects/contact/records/{contact_id}/refile-activities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accounts\": [\n \"0015g00000AbCdEAAV\"\n ],\n \"window_days\": 90\n}"
response = http.request(request)
puts response.read_body{
"accounts": [
"<string>"
],
"contact_id": "<string>",
"status": "accepted",
"window_days": 123
}contacts
File a contact's past activities under its accounts
What the app's "Apply to past meetings" prompt does after a change of a contact's accounts: files the contact's activities of the last `window_days` days (those it took part in: meetings, emails, chats) under each account in `accounts` as well, so they show on those accounts' timelines and in their AI answers. It adds and never removes: an activity stays filed where it was (its primary account too), so it is not taken off an account the contact left. Each account must be one the contact is on now (set them with PATCH /v1/objects/contact/records/{contact_id}); others are skipped, and the answer lists the accounts it used. None of them on the contact, or every id blank, is a 422. `window_days` is 1 to 365 (the app offers 15, 90 or a number of days; there is no "all time"). Answers 202 at once: the filing runs in the background and no call reports when it ends; GET /v1/activities?filter[account][eq]=<account id> lists them once filed. A run after an earlier one has ended files nothing twice. A teammate, vendor or digital worker is not a contact: a 404. Where your role sees only your book, the contact must be on an account in it, and so must each account it files under (else a 403), as for an update of the contact; the app's own action has no book check. Send an `Idempotency-Key` header to make a retry safe: the same key replays the first answer and sends nothing again.
POST
/
v1
/
objects
/
contact
/
records
/
{contact_id}
/
refile-activities
File a contact's past activities under its accounts
curl --request POST \
--url https://api.statisfy.com/v1/objects/contact/records/{contact_id}/refile-activities \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accounts": [
"0015g00000AbCdEAAV"
],
"window_days": 90
}
'import requests
url = "https://api.statisfy.com/v1/objects/contact/records/{contact_id}/refile-activities"
payload = {
"accounts": ["0015g00000AbCdEAAV"],
"window_days": 90
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({accounts: ['0015g00000AbCdEAAV'], window_days: 90})
};
fetch('https://api.statisfy.com/v1/objects/contact/records/{contact_id}/refile-activities', 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.statisfy.com/v1/objects/contact/records/{contact_id}/refile-activities",
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([
'accounts' => [
'0015g00000AbCdEAAV'
],
'window_days' => 90
]),
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.statisfy.com/v1/objects/contact/records/{contact_id}/refile-activities"
payload := strings.NewReader("{\n \"accounts\": [\n \"0015g00000AbCdEAAV\"\n ],\n \"window_days\": 90\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.statisfy.com/v1/objects/contact/records/{contact_id}/refile-activities")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accounts\": [\n \"0015g00000AbCdEAAV\"\n ],\n \"window_days\": 90\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.statisfy.com/v1/objects/contact/records/{contact_id}/refile-activities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accounts\": [\n \"0015g00000AbCdEAAV\"\n ],\n \"window_days\": 90\n}"
response = http.request(request)
puts response.read_body{
"accounts": [
"<string>"
],
"contact_id": "<string>",
"status": "accepted",
"window_days": 123
}Authorizations
An API key, sent as Authorization: Bearer stfy_live_…. See Authentication for how to get one and which scopes it needs.
Body
application/json
Response
202 - application/json
Successful Response
Was this page helpful?