Update the Account of the Authenticated User if and only if they are Owner.
URL : /api/accounts/:pk/
Method : PUT
Auth required : YES
Permissions required : User is Account Owner
Data constraints
{
"name": "[unicode 64 chars max]",
}
Data example Partial data is allowed, but there is only one field.
{
"name": "Build something project dot com",
}
Condition : Update can be performed either fully or partially by the Owner of the Account.
Code : 200 OK
Content example : For the example above, when the 'name' is updated and
posted to /api/accounts/123/
...
{
"id": 123,
"name": "New project name",
"enterprise": false,
"url": "http://testserver/api/accounts/123/"
}
Condition : Account does not exist at URL
Code : 404 NOT FOUND
Content : {}
Condition : Authorized User is not Owner of Account at URL.
Code : 403 FORBIDDEN
Content : {}
Endpoint will ignore irrelevant and read-only data such as parameters that
don't exist, or id
and enterprise
fields which are not editable.
E.g. if Account already exits:
Data example
{
"wibble": "flobble",
"id": 987,
"enterprise": true
}
Code : 200 OK
Content example
{
"id": 123,
"name": "New project name",
"enterprise": false,
"url": "http://testserver/api/accounts/123/"
}