Toshl Developer

Update me

Updates currently logged in user information.

PUT /me

Required scope:

Parameters

id *
required
string

User id.

first_name
optional
string

Users first name.

Max length: 150
last_name
optional
string

Users last name.

Max length: 150
currency *
required
object

Currency settings

main *
required
string

Main currency.

Regex: [A-Z0-9_]{2,10}
update
optional
string

Main currency update type.
historical - updates exchange rates based on historical rates,
custom - updates with custom_exchange_rate,
sign - updates just the sign, not the amounts and exchange rates.

Possible values: historical, custom, sign
update_accounts
optional
boolean

If set to true, the accounts will have their exchange rates updated as well

custom_exchange_rate
optional
number

Must be set if update = custom and is ignored otherwise. The main currency conversion will be done with a custom exchange rate. The custom exchange rate is always related to the previously set main currency.

Minimum: >= 0
custom
optional
object

Custom currency.

code
optional
string

Main currency code.

Regex: [A-Z0-9_]{2,10}
rate
optional
number

Main currency exchange rate.

Minimum: >= 0
fixed
optional
boolean

If set to true, the exchange rate is fixed.

Default value: false
reference_currency
optional
string

Reference currency used to define the currency.

Regex: [A-Z0-9_]{2,10}
modified *
required
string

Date user details were last modified.

start_day
optional
integer

User preference for month start day. If set to 5 month will start on the 5th and end on the 4th of the following month.

Minimum: >= 1
Maximum: =< 31
Default value: 1
migration
optional
object

User migration details are returned only for users that were migrated over from the previous system and need to go through a special migration step.

finished
optional
boolean

If finished is false, show migration screen to the user.

locale
optional
string

Users locale

timezone
optional
string

Users timezone

country
optional
string

Users country

Regex: [A-Z]{2}
extra
optional
object

A custom JSON object that you can use to extend Toshl API. Whatever you save into this field you will get back whenever you fetch it later.

* denotes required field/parameter.

Request

$ curl https://api.toshl.com/me \
  -H "Authorization: Bearer T9cE5asGnuyYCCqIZFoWjFHvNbvVqHjl" \
  -H "Content-Type: application/json" \
  -X PUT \
  -d '{json}'

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
  "id": "42",
  "email": "john@example.com",
  "first_name": "John",
  "last_name": "Cleese",
  "joined": "2013-06-19T16:23:05+00:00Z",
  "modified": "2013-07-19T10:12:35+00:00Z",
  "pro": {
    "since": "2010-06-01T12:21:10+00:00Z",
    "until": "2015-07-01T22:10:12+00:00Z",
    "payment": {
      "provider": "paypal",
      "next": "2015-07-01T22:10:12+00:00Z"
    }
  },
  "currency": {
    "main": "XYZ",
    "custom": {
      "code": "XYZ",
      "rate": 1.31,
      "fixed": true,
      "reference_currency": "USD"
    },
    "recent": [{
      "code": "EUR",
      "rate": 1.546,
      "fixed": true,
      "reference_currency": "USD"
    }]
  },
  "start_day": 5,
  "notifications": 3,
  "social": ["google", "facebook", "foursquare"],
  "steps": ["income", "expense", "budget", "budget_category"],
  "limits": {
    "accounts": true,
    "budgets": true,
    "images": true
  }
}