Account Locks
Minimum access level: Full Access.
This endpoint allows API applications to retrieve information on a company's account locks and to set or remove the user account lock.
Attributes
An account lock has the following attributes:
| Attribute | Description | Kind |
|---|---|---|
| locked_to_date | The date of the account lock | Date |
| user_lock | true for the user account lock, omitted otherwise. Only the user account lock can be updated or deleted. |
Boolean |
| locked_by_description | A description of the resource associated with the account lock. For the user lock, this will be the user or account manager who created the lock. | String |
| locked_by_url | A unique identifier for the resource associated with the account lock, where one is available. | URI |
We also include the following optional top-level attributes in the response when listing account locks:
| Attribute | Description | Kind |
|---|---|---|
| earliest_lock_date | The earliest date at which it is possible to set a user account lock. | Date |
| latest_lock_date | The latest date at which it is possible to set a user account lock. | Date |
If earliest_lock_date is not present, it is not possible to set a user account lock.
List Account Locks for a company
GET https://api.freeagent.com/v2/account_locks
Response
Status: 200 OK
{
"account_locks": [
{
"locked_to_date": "2024-03-31",
"user_lock": true,
"locked_by_description": "Nathan Barley",
"locked_by_url": "https://api.freeagent.com/v2/users/1"
},
{
"locked_to_date": "2023-12-31",
"locked_by_description": "Accounting Year End 2023/23"
}
],
"earliest_lock_date": "2024-01-01",
"latest_lock_date": "2024-12-31"
}
Show as XML<?xml version="1.0" encoding="UTF-8"?>
Create or Update the User Account Lock
PUT https://api.freeagent.com/v2/account_locks
Request
{
"account_lock": {
"locked_to_date": "2024-01-01"
}
}
Show as XML<?xml version="1.0" encoding="UTF-8"?>
<freeagent>
<account-lock>
<locked-to-date type="date">2024-01-01</locked-to-date>
</account-lock>
</freeagent>
Show as JSONResponse
Status: 204 No Content
Delete the User Account Lock
DELETE https://api.freeagent.com/v2/account_locks
Response
Status: 204 No Content