Skip to main content
PUT
/
clients
/
{client_id}
/
budget
Update Client Budget
curl --request PUT \
  --url https://api.everhour.com/clients/{client_id}/budget \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <api-key>' \
  --data '
{
  "type": "money",
  "budget": 100000,
  "period": "general",
  "appliedFrom": "<string>",
  "disallowOverbudget": true,
  "excludeUnbillableTime": true,
  "excludeExpenses": true,
  "threshold": 123
}
'
import requests

url = "https://api.everhour.com/clients/{client_id}/budget"

payload = {
    "type": "money",
    "budget": 100000,
    "period": "general",
    "appliedFrom": "<string>",
    "disallowOverbudget": True,
    "excludeUnbillableTime": True,
    "excludeExpenses": True,
    "threshold": 123
}
headers = {
    "X-Api-Key": "<api-key>",
    "Content-Type": "application/json"
}

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

print(response.text)
const options = {
  method: 'PUT',
  headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    type: 'money',
    budget: 100000,
    period: 'general',
    appliedFrom: '<string>',
    disallowOverbudget: true,
    excludeUnbillableTime: true,
    excludeExpenses: true,
    threshold: 123
  })
};

fetch('https://api.everhour.com/clients/{client_id}/budget', 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.everhour.com/clients/{client_id}/budget",
  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([
    'type' => 'money',
    'budget' => 100000,
    'period' => 'general',
    'appliedFrom' => '<string>',
    'disallowOverbudget' => true,
    'excludeUnbillableTime' => true,
    'excludeExpenses' => true,
    'threshold' => 123
  ]),
  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://api.everhour.com/clients/{client_id}/budget"

	payload := strings.NewReader("{\n  \"type\": \"money\",\n  \"budget\": 100000,\n  \"period\": \"general\",\n  \"appliedFrom\": \"<string>\",\n  \"disallowOverbudget\": true,\n  \"excludeUnbillableTime\": true,\n  \"excludeExpenses\": true,\n  \"threshold\": 123\n}")

	req, _ := http.NewRequest("PUT", 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.put("https://api.everhour.com/clients/{client_id}/budget")
  .header("X-Api-Key", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"type\": \"money\",\n  \"budget\": 100000,\n  \"period\": \"general\",\n  \"appliedFrom\": \"<string>\",\n  \"disallowOverbudget\": true,\n  \"excludeUnbillableTime\": true,\n  \"excludeExpenses\": true,\n  \"threshold\": 123\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.everhour.com/clients/{client_id}/budget")

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

request = Net::HTTP::Put.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"type\": \"money\",\n  \"budget\": 100000,\n  \"period\": \"general\",\n  \"appliedFrom\": \"<string>\",\n  \"disallowOverbudget\": true,\n  \"excludeUnbillableTime\": true,\n  \"excludeExpenses\": true,\n  \"threshold\": 123\n}"

response = http.request(request)
puts response.read_body
{
  "id": 4567,
  "name": "Client Name",
  "projects": [
    "ev:1234567890"
  ],
  "businessDetails": "<string>",
  "budget": {
    "type": "money",
    "budget": 100000,
    "period": "general",
    "appliedFrom": "<string>",
    "disallowOverbudget": true,
    "excludeUnbillableTime": true,
    "excludeExpenses": true,
    "threshold": 123,
    "progress": 0
  }
}

Authorizations

X-Api-Key
string
header
required

Path Parameters

client_id
number
required

Client ID

Example:

107

Body

application/json
type
enum<string>
required

Budget Type

Available options:
money,
time,
costs
Example:

"money"

budget
number
required

Budget value in cents (for money) or seconds (for time)

Example:

100000

period
enum<string>
required

Budget periodicity (overall, monthly, weekly, daily)

Available options:
general,
monthly,
weekly,
daily,
quarterly,
yearly
Example:

"general"

appliedFrom
string | null

Start budget from (available only for non-recurrent budgets)

disallowOverbudget
boolean
excludeUnbillableTime
boolean
excludeExpenses
boolean
threshold
number

Email admins when threshold reached. Threshold is percentage 1 - 100.

Response

OK

id
number
required
Example:

4567

name
string
required
Example:

"Client Name"

projects
string[]
required

List of projects ID

Example:
["ev:1234567890"]
businessDetails
string | null
budget
object