{"type":"api","title":"Create User","meta":{"id":"/apps/pubhub/media/cloud-security-gov/9ead083ce611c254ac9201d1e76003bd3d4b4b6b/c24e887e-1827-3004-af8d-fdd6677097c8","info":{"title":"Cisco Umbrella for Government Users and Roles API","version":"2.0.0","description":"Manage the Umbrella user accounts and roles.","contact":{"name":"Cloud Security Developer Community"}},"security":[{"oauthFlow":[]}],"tags":[{"name":"Users"},{"name":"Roles"},{"name":"Umbrella"}],"x-parser-conf":{"overview":{"markdownPath":"reference/admin/users-roles-overview.md","uri":"umbrella-api-reference-users-roles-overview"}},"openapi":"3.0.1","servers":[{"url":"https://api.umbrellagov.com/{basePath}","variables":{"basePath":{"default":"admin/v2"}}}],"securitySchemes":{"oauthFlow":{"type":"oauth2","description":"client credential flow","flows":{"clientCredentials":{"tokenUrl":"https://api.umbrellagov.com/auth/v2/token","scopes":{"admin.users:read":"Read admin users","admin.users:write":"Write admin users","admin.roles:read":"Read admin roles"}}}}}},"spec":{"summary":"Create User","operationId":"createUser","tags":["Users","Umbrella"],"description":"Create an Umbrella user account with a designated role.\n\nOnce a user account is deleted, you can recreate the account through the `POST` operation.\nWhen you recreate the user account, only set the `email` and `roleId` fields in the Request Body.\n\nFor example: {\n \"email\": \"DEVWKS-22@mailinator.com\",\n \"roleId\": 1\n}\n\nIf you provide all fields for the user account in the Request Body, Umbrella returns an `HTTP/400` (Bad Request) with the\nmessage: `Email already in use`.","security":[{"oauthFlow":["admin.users:write"]}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"firstname":{"type":"string","description":"The user's first name.","minLength":1},"lastname":{"type":"string","description":"The user's last name.","minLength":1},"email":{"type":"string","description":"The user's email address.","minLength":1},"password":{"type":"string","description":"The user's password.","minLength":1},"roleId":{"type":"integer","description":"The role ID.","minimum":1},"timezone":{"type":"string","description":"The user's timezone.","minLength":1}},"type":"object","required":["email","password","firstname","lastname","roleId","timezone"]},"example":{"firstname":"user first name","lastname":"user last name","email":"user email","password":"user password","roleId":1,"timezone":"user timezone name"}}},"description":"Create a user account."},"responses":{"200":{"description":"OK","headers":{"Content-Type":{"schema":{"type":"string"},"description":"The MIME content type of the response body.","example":"application/json","$$ref":"#/components/headers/Content-Type"},"Date":{"schema":{"type":"string","format":"iso-date-time"},"description":"The date and time of the request that is represented in ISO 8601 format.\nThe timestamp uses Greenwich Mean Time (GMT).","example":"Date: Mon, 18 Apr 2022 11:11:11 GMT","$$ref":"#/components/headers/Date"}},"content":{"application/json":{"schema":{"type":"object","properties":{"firstname":{"type":"string","description":"The user's first name.","minLength":1},"lastname":{"type":"string","description":"The user's last name.","minLength":1},"email":{"type":"string","description":"The user's email address.","minLength":1},"password":{"type":"string","description":"The user's password.","minLength":1},"roleId":{"type":"integer","description":"The role ID.","minimum":1},"role":{"type":"string","description":"The user's role."},"timezone":{"type":"string","description":"The user's timezone.","minLength":1},"status":{"type":"string","description":"The user's status.","example":"on"},"lastLoginTime":{"type":"string","format":"date-time","description":"The user's last login date and time (ISO8601 timestamp).","example":"2018-06-13T16:07:07.222Z"},"twoFactorEnable":{"type":"boolean","description":"Specifies whether two-factor authentication is enabled."}},"required":["id","email","role","roleId","timezone","status","twoFactorEnable"],"example":{"id":123,"email":"myemail.com","role":"full admin","roleId":1,"timezone":"2018-06-13T16:07:07.222Z","status":"on","twoFactorEnable":true},"$$ref":"#/components/schemas/UserObject"},"example":{"id":1234,"firstname":"user first name","lastname":"user last name","email":"user email","role":"user role name","roleId":2,"timezone":"user timezone name","status":"user status","lastLoginTime":"2018-06-13T16:07:07.222Z","twoFactorEnable":true}}}},"400":{"description":"Bad Request","headers":{"Content-Type":{"schema":{"type":"string"},"description":"The MIME content type of the response body.","example":"application/json","$$ref":"#/components/headers/Content-Type"},"Date":{"schema":{"type":"string","format":"iso-date-time"},"description":"The date and time of the request that is represented in ISO 8601 format.\nThe timestamp uses Greenwich Mean Time (GMT).","example":"Date: Mon, 18 Apr 2022 11:11:11 GMT","$$ref":"#/components/headers/Date"}},"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}},"example":{"message":"Invalid request"}}},"$$ref":"#/components/responses/400Error"},"401":{"description":"Unauthorized","headers":{"Content-Type":{"schema":{"type":"string"},"description":"The MIME content type of the response body.","example":"application/json","$$ref":"#/components/headers/Content-Type"},"Date":{"schema":{"type":"string","format":"iso-date-time"},"description":"The date and time of the request that is represented in ISO 8601 format.\nThe timestamp uses Greenwich Mean Time (GMT).","example":"Date: Mon, 18 Apr 2022 11:11:11 GMT","$$ref":"#/components/headers/Date"}},"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}},"example":{"message":"Unauthorized request"}}},"$$ref":"#/components/responses/401Error"},"403":{"description":"Forbidden","headers":{"Content-Type":{"schema":{"type":"string"},"description":"The MIME content type of the response body.","example":"application/json","$$ref":"#/components/headers/Content-Type"},"Date":{"schema":{"type":"string","format":"iso-date-time"},"description":"The date and time of the request that is represented in ISO 8601 format.\nThe timestamp uses Greenwich Mean Time (GMT).","example":"Date: Mon, 18 Apr 2022 11:11:11 GMT","$$ref":"#/components/headers/Date"}},"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}},"example":{"message":"Forbidden"}}},"$$ref":"#/components/responses/403Error"},"404":{"description":"Not Found","headers":{"Content-Type":{"schema":{"type":"string"},"description":"The MIME content type of the response body.","example":"application/json","$$ref":"#/components/headers/Content-Type"},"Date":{"schema":{"type":"string","format":"iso-date-time"},"description":"The date and time of the request that is represented in ISO 8601 format.\nThe timestamp uses Greenwich Mean Time (GMT).","example":"Date: Mon, 18 Apr 2022 11:11:11 GMT","$$ref":"#/components/headers/Date"}},"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}},"example":{"message":"Not Found"}}},"$$ref":"#/components/responses/404Error"},"500":{"description":"Internal Server Error","headers":{"Content-Type":{"schema":{"type":"string"},"description":"The MIME content type of the response body.","example":"application/json","$$ref":"#/components/headers/Content-Type"},"Date":{"schema":{"type":"string","format":"iso-date-time"},"description":"The date and time of the request that is represented in ISO 8601 format.\nThe timestamp uses Greenwich Mean Time (GMT).","example":"Date: Mon, 18 Apr 2022 11:11:11 GMT","$$ref":"#/components/headers/Date"}},"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}},"example":{"message":"Server error"}}},"$$ref":"#/components/responses/500Error"}},"__originalOperationId":"createUser","method":"post","path":"/users"}}