{"info":{"_postman_id":"56ded7bf-563b-48b3-a1da-5ec101a95417","name":"Avia HR API","description":"<html><head></head><body><p>API collection for creating &amp; suspending users on AVIA LMS.</p>\n<p>All API routes accept bearer access token for authorization.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"1713071","collectionId":"56ded7bf-563b-48b3-a1da-5ec101a95417","publishedId":"2sA2r55Rt5","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2025-03-17T22:33:51.000Z"},"item":[{"name":"User Create","event":[{"listen":"test","script":{"id":"e647461b-0e99-48c3-a916-a2ed54d99fb3","exec":["pm.test(\"Status code is 201\", function () {","    pm.response.to.have.status(201);","});","","pm.test(\"Response has ID property\", function () {","    pm.expect(pm.response.json()).to.have.property('ID');","});","","pm.test(\"Response has message property\", function () {","    pm.expect(pm.response.json()).to.have.property('message');","});"],"type":"text/javascript","packages":{}}}],"id":"3bd0c49e-8160-4089-90c0-ccb4b185b98b","protocolProfileBehavior":{"disableBodyPruning":true,"disabledSystemHeaders":{}},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{access_token}}"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n\t\"user_login\": \"jdoe\",\n\t\"email\": \"jdoe@example.com\",\n\t\"username\": \"jdoe\",\n\t\"user_pass\": \"password\",\n\t\"first_name\": \"John\",\n\t\"last_name\": \"Doe\",\n\t\"name\": \"John Doe\",\n\t\"role\": \"subscriber\",\n\t\"locale\": \"is_IS\",\n\t\"fields\": {\n\t\t\"ssn\": \"123-45-6789\",\n\t\t\"department\": \"Sales\",\n\t\t\"job_title\": \"Sales Associate\",\n\t\t\"id\": \"693\",\n\t\t\"detail_id\": \"6931\",\n\t\t\"manager_name\": \"Jane Smith\",\n\t\t\"manager_ids\": [\"789\", \"012\"],\n\t\t\"work_email\": \"jdoe@work.com\",\n\t\t\"phone\": \"555-555-5555\",\n\t\t\"employment_status\": \"full_time\",\n\t\t\"employment_status_name\": \"Full Time\",\n\t\t\"address\": \"123 Main St\",\n\t\t\"postal_code\": \"12345\",\n\t\t\"city\": \"Anytown\"\n\t}\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url}}/wp-json/avia/hr/v1/user","description":"<h3 id=\"add-user-information\">Add User Information</h3>\n<p>This endpoint allows you to add user information to the HR system.</p>\n<ul>\n<li>Method: POST</li>\n<li>Base URL: {{base_url}}/wp-json/avia/hr/v1/user</li>\n</ul>\n<h4 id=\"request-body\">Request Body</h4>\n<ul>\n<li>Request Body Type: Raw</li>\n<li>Payload</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"email\": \"\",\n    \"username\": \"\",\n    \"user_pass\": null,\n    \"first_name\": \"\",\n    \"last_name\": \"\",\n    \"name\": \"\",\n    \"locale\": \"\",\n    \"fields\": {\n        \"ssn\": \"\",\n        \"department\": \"\",\n        \"job_title\": \"\",\n        \"id\": \"\",\n        \"detail_id\": \"\",\n        \"manager_name\": \"\",\n        \"manager_ids\": [\"\"],\n        \"work_email\": \"\",\n        \"phone\": \"\",\n        \"employment_status\": \"\",\n        \"employment_status_name\": \"\",\n        \"address\": \"\",\n        \"postal_code\": \"\",\n        \"city\": \"\"\n    }\n}\n\n</code></pre>\n<h4 id=\"required-parameters\">Required Parameters</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"email\": {},\n  \"username\": {},\n  \"first_name\": {},\n  \"last_name\": {},\n  \"name\": {},\n  \"fields\": {\n    \"ssn\": {},\n    \"department\": {},\n    \"job_title\": {},\n    \"id\": {},\n    \"detail_id\": {},\n    \"employment_status\": {},\n    \"employment_status_name\": {}\n  }\n}\n\n</code></pre>\n<h4 id=\"response\">Response</h4>\n<ul>\n<li>Status: 201</li>\n<li>Content-Type: application/json</li>\n<li>Body</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"ID\": 0,\n  \"message\": \"\"\n}\n\n</code></pre>\n<p>Validation</p>\n<p>The LMS systems validates the following attributes to be unique. If any existing record found with following attributes, the system will return an error with 400 code.</p>\n<ul>\n<li>Email</li>\n<li>Username</li>\n<li>Social Security Number</li>\n</ul>\n","urlObject":{"path":["wp-json","avia","hr","v1","user"],"host":["{{base_url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"3bd0c49e-8160-4089-90c0-ccb4b185b98b"},{"name":"User Suspend/Unsuspend","event":[{"listen":"test","script":{"id":"988f390d-39ee-40df-bb76-34c635186abb","exec":["pm.test(\"Status code is 201\", function () {","    pm.response.to.have.status(201);","});","","pm.test(\"Response has ID property\", function () {","    pm.expect(pm.response.json()).to.have.property('ID');","});","","pm.test(\"Response has status property\", function () {","    pm.expect(pm.response.json()).to.have.property('status');","});"],"type":"text/javascript","packages":{}}}],"id":"654f1161-a470-4a7f-9d05-2b959bf1427e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{access_token}}"}]},"isInherited":false},"method":"GET","header":[],"url":"{{base_url}}/wp-json/avia/hr/v1/suspend/{{ssn}}?action=unsuspend","description":"<p>This API endpoint sends an HTTP GET request to suspend a specific user with SSN. The request includes a query parameter \"action\" with the value \"suspend\" or \"unsuspend\".</p>\n<h3 id=\"response\">Response</h3>\n<p>Upon successful execution, the endpoint returns a status code of 201 and a JSON object in the response body with a key \"status\" indicating the current status of the suspension.</p>\n<p>Example response:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"suspended\" // status of the action, suspended OR unsuspended\n}\n\n</code></pre>\n","urlObject":{"path":["wp-json","avia","hr","v1","suspend","{{ssn}}"],"host":["{{base_url}}"],"query":[{"key":"action","value":"unsuspend"}],"variable":[]}},"response":[],"_postman_id":"654f1161-a470-4a7f-9d05-2b959bf1427e"},{"name":"Find User by SSN","id":"a9628041-2eff-42d9-bffe-4f814123b7d3","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{access_token}}"}]},"isInherited":false},"method":"GET","header":[],"url":"{{base_url}}/wp-json/avia/hr/v1/user/ssn/{{ssn}}","description":"<p>Endpoint to search user by SSN in LMS.</p>\n<p>If user found, will return success code `user_found` with user's ID on LMS &amp; SSN.</p>\n<p>If not found, `ssn_not_found` error code will be returned.</p>\n","urlObject":{"path":["wp-json","avia","hr","v1","user","ssn","{{ssn}}"],"host":["{{base_url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"a9628041-2eff-42d9-bffe-4f814123b7d3"},{"name":"User Update","id":"7a0fb3a6-a446-4ece-9a98-ae67f1334682","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{access_token}}"}]},"isInherited":false},"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n  \"ssn\": \"12345678990000\",\n  \"email\": \"test.user@avia.is\",\n  \"username\": \"test.user@avia.is\",\n  \"first_name\": \"Test\",\n  \"last_name\": \"User\",\n  \"name\": \"Test User Avia\",\n  \"locale\": \"is_IS\",\n  \"fields\": {\n    \"department\": \"Test Dept\",\n    \"job_title\": \"Test Job Title\",\n    \"id\": \"1131\",\n    \"detail_id\": \"11311\",\n    \"manager_name\": \"Unaib Avia\",\n    \"manager_ids\": [\"\"],\n    \"phone\": \"098765\",\n    \"employment_status\": \"6\",\n    \"employment_status_name\": \"Í starfi\",\n    \"address\": \"Test Address\",\n    \"postal_code\": \"\",\n    \"city\": \"\"\n  }\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url}}/wp-json/avia/hr/v1/user/update","description":"<p>This API endpoint can be used to update user information. If no value is provided for any parameter like name, it will be updated as well with empty value. So it is recommended to provide all parameters even if the values are same.</p>\n<p>This endpoint accepts similar JSON object which is being used to create a new user. The only difference is JSON object is SSN parameter has been moved one step above. Example JSON object:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"ssn\": \"12345678990000\",\n  \"email\": \"test.user@avia.is\",\n  \"username\": \"test.user@avia.is\",\n  \"first_name\": \"Test\",\n  \"last_name\": \"User\",\n  \"name\": \"Test User Avia\",\n  \"locale\": \"is_IS\",\n  \"fields\": {\n    \"department\": \"Test Dept\",\n    \"job_title\": \"Test Job Title\",\n    \"id\": \"1131\",\n    \"detail_id\": \"11311\",\n    \"manager_name\": \"Unaib Avia\",\n    \"manager_ids\": [\"\"],\n    \"phone\": \"098765\",\n    \"employment_status\": \"6\",\n    \"employment_status_name\": \"Í starfi\",\n    \"address\": \"Test Address\",\n    \"postal_code\": \"\",\n    \"city\": \"\"\n  }\n}\n\n</code></pre>\n","urlObject":{"path":["wp-json","avia","hr","v1","user","update"],"host":["{{base_url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"7a0fb3a6-a446-4ece-9a98-ae67f1334682"},{"name":"Delete User","id":"d63a0be0-6252-405e-99ec-5d2811fdf7b3","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{access_token}}"}]},"isInherited":false},"method":"DELETE","header":[],"url":"{{base_url}}/wp-json/avia/hr/v1/user/delete/{{ssn}}","description":"<p>Endpoint to delete user by SSN in LMS.</p>\n","urlObject":{"path":["wp-json","avia","hr","v1","user","delete","{{ssn}}"],"host":["{{base_url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"d63a0be0-6252-405e-99ec-5d2811fdf7b3"},{"name":"Update User Role","id":"48d7ee5a-d31b-4795-ba32-b7761f559eb2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{access_token}}"}]},"isInherited":false},"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n\t\"role\": \"group_leader\",\n\t\"ssn\": \"2561062839\"\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url}}/wp-json/avia/hr/v1/user/update/role","description":"<p>This API endpoint can be used to update user role. It accepts a JSON object having following parameters with possible values:</p>\n<ul>\n<li><p>ssn: accepts 10 digit SSN for the user</p>\n</li>\n<li><p>role: accepts role name for the user. It can be either 'user', 'group_leader', or 'admin'.  </p>\n<p>  Example JSON object:</p>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"ssn\": \"12345678990000\",\n  \"role\": \"group_leader\"\n}\n\n</code></pre>\n","urlObject":{"path":["wp-json","avia","hr","v1","user","update","role"],"host":["{{base_url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"48d7ee5a-d31b-4795-ba32-b7761f559eb2"},{"name":"Get all Learning Groups","id":"b362cb57-aff6-4c8d-b29a-2e036b8fc35f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"{{base_url}}/wp-json/avia/hr/v1/groups","description":"<p>Provides a list of all Learning Groups in a system. Also provides a total number of users in a single learning group.</p>\n<p>Additional parameters:</p>\n<ul>\n<li><code>search</code>: this parameter can be used to search specific group by its title.</li>\n</ul>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{access_token}}"}]},"isInherited":true,"source":{"_postman_id":"56ded7bf-563b-48b3-a1da-5ec101a95417","id":"56ded7bf-563b-48b3-a1da-5ec101a95417","name":"Avia HR API","type":"collection"}},"urlObject":{"path":["wp-json","avia","hr","v1","groups"],"host":["{{base_url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"b362cb57-aff6-4c8d-b29a-2e036b8fc35f"},{"name":"Get Single Learning Group","id":"d1183ca4-c37d-4b76-8750-9cd4b5ec60e2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{base_url}}/wp-json/avia/hr/v1/groups/470543","description":"<p>Provides info of a single Learning Group. It also provides a list of users and managers (group admins/leaders) of the group.</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{access_token}}"}]},"isInherited":true,"source":{"_postman_id":"56ded7bf-563b-48b3-a1da-5ec101a95417","id":"56ded7bf-563b-48b3-a1da-5ec101a95417","name":"Avia HR API","type":"collection"}},"urlObject":{"path":["wp-json","avia","hr","v1","groups","470543"],"host":["{{base_url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"d1183ca4-c37d-4b76-8750-9cd4b5ec60e2"},{"name":"Create a new Learning Group","id":"e96588a2-eef8-415c-974e-6f271b96a7d8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"title\": \"Test Group\",\n    \"group_users\": [\n        \"34523434234234234\",\n        \"1313123213123123\"\n    ],\n    \"group_admins\": [\n        \"1234567890\"\n    ],\n    \"social_group_create\": true,\n    \"social_group_status\" : \"public\"\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url}}/wp-json/avia/hr/v1/groups","description":"<p>It can be used to create a new Learning Group. Below is an example payload. If `social_group_create` param is provided with true value, it will create Social Group with same title as well. And add users to this newly created social group as well with same roles.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"title\": \"Test HRAF Group\",\n    \"group_users\": [\n        \"34523434234234234\",\n        \"1313123213123123\"\n    ],\n    \"group_admins\": [\n        \"1234567890\"\n    ],\n    \"social_group_create\": true,\n    \"social_group_status\" : \"public\"\n}\n\n</code></pre>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{access_token}}"}]},"isInherited":true,"source":{"_postman_id":"56ded7bf-563b-48b3-a1da-5ec101a95417","id":"56ded7bf-563b-48b3-a1da-5ec101a95417","name":"Avia HR API","type":"collection"}},"urlObject":{"path":["wp-json","avia","hr","v1","groups"],"host":["{{base_url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"e96588a2-eef8-415c-974e-6f271b96a7d8"},{"name":"Enrol Users & Managers to a Learning Group","id":"375731ea-91f1-41f2-bb7a-36b37ccaf098","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"group_id\": 70543,\n    \"group_users\": [\n        \"1006823039\",\n        \"1313123213123123\"\n    ],\n    \"group_admins\": [\n        \"1234567890\",\n        \"1231231231231231\"\n    ],\n    \"update_social_group\": true\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url}}/wp-json/avia/hr/v1/groups/enroll","description":"<p>It is used to enrol users &amp; managers as group leaders in a single group. Below is an example payload for this. If `update_social_group` param is provided with true value, this will update the social group as well by adding users to social group with same roles.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"group_id\": 472660,\n    \"group_users\": [\n        \"43943900324\",\n        \"1313123213123123\"\n    ],\n    \"group_admins\": [\n        \"1234567890\",\n        \"1231231231231231\"\n    ],\n    \"update_social_group\": true\n}\n\n</code></pre>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{access_token}}"}]},"isInherited":true,"source":{"_postman_id":"56ded7bf-563b-48b3-a1da-5ec101a95417","id":"56ded7bf-563b-48b3-a1da-5ec101a95417","name":"Avia HR API","type":"collection"}},"urlObject":{"path":["wp-json","avia","hr","v1","groups","enroll"],"host":["{{base_url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"375731ea-91f1-41f2-bb7a-36b37ccaf098"},{"name":"Users List","id":"9a97d0af-edc9-4cb7-8e56-84127e9c4708","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{base_url}}/wp-json/avia/hr/v1/user?per_page=100&role=all","description":"<p>Provides a list of all users in a system.</p>\n<p>Parameters:</p>\n<ul>\n<li><p>page</p>\n</li>\n<li><p>per_page</p>\n</li>\n<li><p>role: This parameter accepts 'user', 'group_leader', 'admin' or 'all'.</p>\n</li>\n</ul>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{access_token}}"}]},"isInherited":true,"source":{"_postman_id":"56ded7bf-563b-48b3-a1da-5ec101a95417","id":"56ded7bf-563b-48b3-a1da-5ec101a95417","name":"Avia HR API","type":"collection"}},"urlObject":{"path":["wp-json","avia","hr","v1","user"],"host":["{{base_url}}"],"query":[{"disabled":true,"key":"page","value":"1"},{"key":"per_page","value":"100"},{"key":"role","value":"all"}],"variable":[]}},"response":[],"_postman_id":"9a97d0af-edc9-4cb7-8e56-84127e9c4708"}],"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{access_token}}"}]}},"event":[{"listen":"prerequest","script":{"id":"34f87639-3b3c-4cd9-aedb-91715ea3baeb","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"60600d9f-cd97-43bc-bfce-2357d187608a","type":"text/javascript","exec":[""]}}]}