Create Account
/accounts
Create Account [POST]
Create a new account.
The InspectAll API will respond with a 412: Precondition Failed
if the account name looks similar to other account names, or if the account num matches another account num. Include "confirmed": true
in the following request to continue creating the account.
Authorization: Admin, Web, Mobile
Request
{ "name": "Springfield Nuclear Plant", "num": "SPN190", "rowStatus": 1, "address": "123 Springfield Street", "city": "Springfield", "state": "", "zip": "80982", "country": "US", "teamIds": [1,2,3] }
Response 200
Body
{ "item": { "id": 9082, "num": "SNP190", "name": "Springfield Nuclear Plant", "address": "123 Springfield Street", "city": "Springfield", "state": null, "zip": "80982", "country": "US", "rowStatus": 1, "createdBy": "290", "createdAt": "2015-05-19T16:37:19.827Z", "modifiedAt": "2015-05-20T20:22:24.643Z", "teamIds": [ 1, 2, 3 ] } }
Response 412
Body
{ "similarAccounts": [ { "id": 12908, "name": "South Netherlands Engineering", "num": "SNP190" },{ "id": 9082, "name": "Springfield Nuclear Plant INC", "num": "SNPINC" } ] }
Response 422
Body
{ "errors": { "teamIds": [ "At least (1) Team is required." ], "name": [ "Name is required." ] } }