Sync admin organization staking farm credits
curl --request POST \
--url https://cloud-api.near.ai/v1/admin/organizations/{org_id}/staking/farm/sync \
--header 'Authorization: Bearer <token>'import requests
url = "https://cloud-api.near.ai/v1/admin/organizations/{org_id}/staking/farm/sync"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://cloud-api.near.ai/v1/admin/organizations/{org_id}/staking/farm/sync', 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://cloud-api.near.ai/v1/admin/organizations/{org_id}/staking/farm/sync",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://cloud-api.near.ai/v1/admin/organizations/{org_id}/staking/farm/sync"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://cloud-api.near.ai/v1/admin/organizations/{org_id}/staking/farm/sync")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud-api.near.ai/v1/admin/organizations/{org_id}/staking/farm/sync")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"active_positions": "<unknown>",
"contract_id": "<string>",
"credit_nano_usd_per_reward_unit": 123,
"farm_product_id": "<string>",
"near_account_id": "<string>",
"network_id": "<string>",
"organization_id": "<string>",
"sync_status": "<string>",
"accumulated_reward_units_24": "<string>",
"farm_credit_nano_usd": 123,
"farm_price_id": "<string>",
"last_sync_error": "<string>",
"last_synced_at": "<string>",
"last_synced_credit_nano_usd": 123,
"last_synced_reward_units_24": "<string>",
"pending_reward_units_24": "<string>",
"total_earned_reward_units_24": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}Admin
Sync admin organization staking farm credits
Refreshes staking farm reward units and derived credits for any linked organization. Requires platform admin access.
POST
/
v1
/
admin
/
organizations
/
{org_id}
/
staking
/
farm
/
sync
Sync admin organization staking farm credits
curl --request POST \
--url https://cloud-api.near.ai/v1/admin/organizations/{org_id}/staking/farm/sync \
--header 'Authorization: Bearer <token>'import requests
url = "https://cloud-api.near.ai/v1/admin/organizations/{org_id}/staking/farm/sync"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://cloud-api.near.ai/v1/admin/organizations/{org_id}/staking/farm/sync', 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://cloud-api.near.ai/v1/admin/organizations/{org_id}/staking/farm/sync",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://cloud-api.near.ai/v1/admin/organizations/{org_id}/staking/farm/sync"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://cloud-api.near.ai/v1/admin/organizations/{org_id}/staking/farm/sync")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud-api.near.ai/v1/admin/organizations/{org_id}/staking/farm/sync")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"active_positions": "<unknown>",
"contract_id": "<string>",
"credit_nano_usd_per_reward_unit": 123,
"farm_product_id": "<string>",
"near_account_id": "<string>",
"network_id": "<string>",
"organization_id": "<string>",
"sync_status": "<string>",
"accumulated_reward_units_24": "<string>",
"farm_credit_nano_usd": 123,
"farm_price_id": "<string>",
"last_sync_error": "<string>",
"last_synced_at": "<string>",
"last_synced_credit_nano_usd": 123,
"last_synced_reward_units_24": "<string>",
"pending_reward_units_24": "<string>",
"total_earned_reward_units_24": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}Authorizations
JWT access token for user authentication (Authorization: Bearer <jwt_token>). Create via POST /users/me/access_tokens.
Path Parameters
Organization ID
Response
Synced organization staking farm state