-
Notifications
You must be signed in to change notification settings - Fork 7
put accounts id
Harmun edited this page May 16, 2019
·
3 revisions
put | /accounts/:id | Admin/User | Update an account specified by id | { name } | { id, name, owner, deletedAt, lastUpdated, balance } |
Update an account specified by id.
- Users can only manipulate accounts tied to their own ID, unless they have the admin user role.
- The id parameter must be numeric.
- Currently only the
name
field is supported.
Request formats | JSON |
Requires authentication? | Yes |
name | string |
Name | Required | Description | Role | Example |
---|---|---|---|---|
name | required | The account's new name | user | "mySavingsAccount" |
curl -X PUT \
http://localhost:3000/accounts/2 \
-H 'Authorization: Bearer 123testtoken123' \
-H 'Content-Type: application/json' \
-H 'Host: localhost:3000' \
-d '{
"name" : "completeInfinityGlove"
}'
The updated account is returned as an object like this:
{
"id": 2,
"name": "completeInfinityGlove",
"owner": 2,
"deletedAt": null,
"lastUpdated": "2019-05-15T09:20:29.000Z",
"balance": 6
}