---
# System prepended metadata

title: Authorization

---

# Authorization
base url
```
https://api-dev.evaly.com.bd/eauth/api/v1/auth
```
## Platform
### Create Platform
Method `POST`
URL: `{{ _.base_permission }}/create-platform`
Headers:
```json=
{
    "Authorization": Bearer <token>
}
```
Request Body
```json=
{
	"name": "eBooking",
	"Description": "eBooking Evaly LTD"
}
```
Response:
`status_code: 201`
```json=
{
  "message": "platform created successfully",
  "success": true,
  "data": {
    "name": "ebooking",
    "slug": "ebooking"
  }
```
### View Platforms
Method `GET`
URL `{{ _.base_permission }}/platforms`
Headers:
```json=
{
    "Authorization": Bearer <token>
}
```
Response:
`status_code: 200`
```json=
"message": "fetched platforms successfully",
  "success": true,
  "data": {
    "count": 1,
    "list": [
      {
        "name": "evaly",
        "slug": "evaly",
        "description": "Believe In You",
        "status": "active",
        "created_by": "ishak",
        "updated_by": "ishak",
        "created_at": "2021-04-05T05:14:08.894Z",
        "updated_at": "2021-04-05T05:14:08.894Z"
      }
    ]
  }
```
### Platforms Details
Method `GET`
URL `{{ _.base_permission }}/platform/evaly`
Headers:
```json=
{
    "Authorization": Bearer <token>
}
```
Response:
`status_code: 200`
```json=
{
  "message": "fetched platforms successfully",
  "success": true,
  "data": {
    "name": "evaly",
    "slug": "evaly",
    "description": "Believe In You",
    "status": "active",
    "created_by": "ishak",
    "updated_by": "ishak",
    "created_at": "2021-04-05T05:14:08.894Z",
    "updated_at": "2021-04-05T05:14:08.894Z"
  }
}
```
### Update Platform
Method `PATCH`
URL: `{{ _.base_permission }}/update-platform`
Headers:
```json=
{
    "Authorization": Bearer <token>
}
```
Request Body
```json=
{
	"slug": "hrm",
	"name": "HRM",
	"status": "active",
	"description": "Human Resource Management of Evaly LTD"
}
```
Response:
`status_code: 200`
```json=
{
  "message": "success",
  "success": true,
  "data": {
    "name": "hrm",
    "slug": "hrm",
    "description": "Human Resource Management of Evaly LTD",
    "status": "active",
    "created_by": "ishak",
    "updated_by": "ishak",
    "created_at": "",
    "updated_at": ""
  }
}
```
## Module
### Create Module
Method `POST`
URL: `{{ _.base_permission }}/create-module`
Headers:
```json=
{
    "Authorization": Bearer <token>
}
```
Request Body
```json=
{
	"name": "Settings",
	"Description": "Settings module in Evaly",
	"platform_slug": "evaly"
}
```
Response:
`status_code: 201`
```json=
{
  "message": "module created successfully",
  "success": true,
  "data": {
    "name": "Settings",
    "slug": "settings"
  }
}
```
### View Modules
Method `GET`
URL `{{ _.base_permission }}/modules?platform=evaly`
Headers:
```json=
{
    "Authorization": Bearer <token>
}
```
Response:
`status_code: 200`
```json=
{
  "message": "fetched modules successfully",
  "success": true,
  "data": {
    "count": 4,
    "list": [
      {
        "name": "analytics",
        "slug": "analytics",
        "description": "Advertisement Module of Evaly",
        "status": "inactive",
        "platform_name": "",
        "platform_slug": "evaly",
        "created_by": "ishak",
        "updated_by": "ishak",
        "created_at": "2021-04-12T17:10:53.341Z",
        "updated_at": "2021-05-23T09:29:52.513Z"
      },
      {
        "name": "brand",
        "slug": "brand",
        "description": "Et vel explicabo sed ducimus commodi ut adipisci tempore. Consequatur consequuntur nam iure et nam est quo harum quam. Excepturi repudiandae veniam et unde necessitatibus quam rem quo. Quia inventore aut.",
        "status": "active",
        "platform_name": "",
        "platform_slug": "evaly",
        "created_by": "ishak",
        "updated_by": "ishak",
        "created_at": "2021-04-12T12:26:31.504Z",
        "updated_at": "2021-04-12T12:26:31.504Z"
      },
      {
        "name": "merchant",
        "slug": "merchant",
        "description": "Merchant Module",
        "status": "active",
        "platform_name": "evaly",
        "platform_slug": "evaly",
        "created_by": "ishak",
        "updated_by": "ishak",
        "created_at": "2021-04-26T13:41:24.143Z",
        "updated_at": "2021-04-26T13:41:24.143Z"
      },
      {
        "name": "transaction",
        "slug": "transaction",
        "description": "Transaction module in Evaly",
        "status": "active",
        "platform_name": "",
        "platform_slug": "evaly",
        "created_by": "ishak",
        "updated_by": "ishak",
        "created_at": "2021-04-12T17:10:39.444Z",
        "updated_at": "2021-04-12T17:10:39.444Z"
      }
    ]
  }
}
```
### Module Details
Method `GET`
URL `{{ _.base_permission }}module/evaly/issue-ticket`
Headers:
```json=
{
    "Authorization": Bearer <token>
}
```
Response:
`status_code: 200`
```json=
{
  "message": "fetched platforms successfully",
  "success": true,
  "data": {
    "name": "Issue Ticket",
    "slug": "issue-ticket",
    "description": "Issue Ticket module in Evaly",
    "status": "active",
    "platform_name": "Evaly",
    "platform_slug": "evaly",
    "created_by": "ishak",
    "updated_by": "ishak",
    "created_at": "2021-04-12T17:10:03.785Z",
    "updated_at": "2021-04-12T17:10:03.785Z"
  }
}
```
### Update Module
Method `PATCH`
URL: `{{ _.base_permission }}/update-module`
Headers:
```json=
{
    "Authorization": Bearer <token>
}
```
Request Body
```json=
{
	"name": "Advertisement",
	"slug": "advertisement",
	"description": "Advertisement Module of Evaly",
	"status": "inactive",
	"platform" : "evaly"
}
```
Response:
`status_code: 200`
```json=
{
  "message": "success",
  "success": true,
  "data": {
    "name": "advertisement",
    "slug": "advertisement",
    "description": "Advertisement Module of Evaly",
    "status": "active",
    "platform_name": "",
    "platform_slug": "evaly",
    "created_by": "ishak",
    "updated_by": "ishak",
    "created_at": "",
    "updated_at": ""
  }
}
```
### Delete Module
Method `DELETE`
URL: `{{ _.base_permission }}//delete-module/test_module`
Headers:
```json=
{
    "Secret-key": secretkey
}
```
Response:
`status_code: 200`
```json=
{
  "message": "module deleted successfully",
  "success": true
}
```
## Action
### Create Action
Method `POST`
URL: `{{ _.base_permission }}/create-action`
Headers:
```json=
{
    "Authorization": Bearer <token>
}
```
Request Body
```json=
{
	"name": "efoodissue.view",
	"description": "view efood issue",
	"platform_slug": "issue-ticket",
	"module_slug": "efood-issue"
}
```
Response:
`status_code: 201`
```json=
{
  "message": "action created successfully",
  "success": true,
  "data": {
    "name": "efoodissue.view",
    "slug": "efoodissue-view"
  }
}
```
### View Actions
Method `GET`
URL `{{ _.base_permission }}/actions?platform=ehealth&module=patient`
Headers:
```json=
{
    "Authorization": Bearer <token>
}
```
Response:
`status_code: 200`
```json=
{
  "message": "fetched modules successfully",
  "success": true,
  "data": {
    "platform_name": "ehealth",
    "platform_slug": "ehealth",
    "module_name": "patient",
    "module_slug": "patient",
    "role_name": "",
    "role_slug": "",
    "count": 3,
    "actions": [
      {
        "name": "full.access",
        "slug": "full-access",
        "description": "Full access to this module",
        "checked": false,
        "status": "active"
      },
      {
        "name": "view.medical.records",
        "slug": "view-medical-records",
        "description": "view medical records",
        "checked": false,
        "status": "active"
      },
      {
        "name": "view.user",
        "slug": "view-user",
        "description": "view.user",
        "checked": false,
        "status": "active"
      }
    ]
  }
}
```
### Action Details
Method `GET`
URL `{{ _.base_permission }}/action/ehealth/patient/view-user`
Headers:
```json=
{
    "Authorization": Bearer <token>
}
```
Response:
`status_code: 200`
```json=
{
  "message": "fetched platforms successfully",
  "success": true,
  "data": {
    "name": "view.user",
    "slug": "view-user",
    "platform_name": "ehealth",
    "platform_slug": "ehealth",
    "module_name": "patient",
    "module_slug": "patient",
    "description": "view.user",
    "status": "active",
    "created_by": "ishak",
    "updated_by": "ishak",
    "created_at": "2021-04-27T06:32:11.478Z",
    "updated_at": "2021-04-27T06:32:11.478Z"
  }
}
```
### Update Action
Method `PATCH`
URL: `{{ _.base_permission }}/update-action`
Headers:
```json=
{
    "Authorization": Bearer <token>
}
```
Request Body
```json=
{
	"name": "ViewProductReviews",
	"slug": "viewproductreviews",
	"module_slug": "ratings-and-reviews",
	"plaform_slug": "evaly",
	"status": "active"
}
```
Response:
`status_code: 200`
```json=
{
  "message": "success",
  "success": true,
  "data": {
    "name": "ViewProductReviews",
    "slug": "viewproductreviews",
    "platform_name": "Evaly",
    "platform_slug": "evaly",
    "module_name": "Ratings and Reviews",
    "module_slug": "ratings-and-reviews",
    "description": "-",
    "status": "active",
    "created_by": "ishak",
    "updated_by": "ishak",
    "created_at": "2021-03-10T11:04:58.834Z",
    "updated_at": "2021-03-10T11:04:58.834Z"
  }
}
```
### Delete Action
Method `DELETE`
URL: `{{ _.base_permission }}/delete-action/<platform_slug>/<module_slug>/<action_slug>`
Headers:
```json=
{
    "Secret-key": secretkey
}
```
Response:
`status_code: 200`
```json=
{
  "message": "action deleted successfully",
  "success": true
}
```
## Role
### Create Role
Method `POST`
URL: `{{ _.base_permission }}/create-role`
Headers:
```json=
{
    "Authorization": Bearer <token>
}
```
Request Body
```json=
{
	"name": "Permission Manager",
	"description": "To manage permission for all platform"
}
```
Response:
`status_code: 201`
```json=
{
  "message": "Role created successfully",
  "success": true,
  "data": {
    "name": "Permission Manager",
    "slug": "permission-manager"
  }
}
```
### View Roles
Method `GET`
URL `{{ _.base_permission }}/roles`
Headers:
```json=
{
    "Authorization": Bearer <token>
}
```
Response:
`status_code: 200`
```json=
{
  "message": "fetched roles successfully",
  "success": true,
  "data": {
    "count": 3,
    "list": [
      {
        "name": "permission for testing",
        "slug": "permission-for-testing",
        "id": "",
        "description": "Some text",
        "status": "active",
        "created_by": "ishak",
        "updated_by": "ishak",
        "created_at": "2021-05-09T17:03:53.522Z",
        "updated_at": "2021-05-09T17:03:53.522Z",
        "users": 0
      },
      {
        "name": "permission manager",
        "slug": "permission-manager",
        "id": "",
        "description": "Use it with Care",
        "status": "active",
        "created_by": "ishak",
        "updated_by": "nahid",
        "created_at": "2021-04-05T05:18:10.773Z",
        "updated_at": "2021-05-22T16:48:20.875Z",
        "users": 0
      },
      {
        "name": "testpermission",
        "slug": "testpermission",
        "id": "",
        "description": "Some text",
        "status": "active",
        "created_by": "ishak",
        "updated_by": "ishak",
        "created_at": "2021-05-04T08:25:49.946Z",
        "updated_at": "2021-05-09T16:39:31.9Z",
        "users": 0
      }
    ]
  }
}
```
### Role Details
Method `GET`
URL `{{ _.base_permission }}/role/permission-manager`
Headers:
```json=
{
    "Authorization": Bearer <token>
}
```
Response:
`status_code: 200`
```json=
{
  "message": "fetched platforms successfully",
  "success": true,
  "data": {
    "name": "permission manager",
    "slug": "permission-manager",
    "id": "",
    "description": "Use it with Care",
    "status": "active",
    "created_by": "ishak",
    "updated_by": "nahid",
    "created_at": "2021-04-05T05:18:10.773Z",
    "updated_at": "2021-05-22T16:48:20.875Z",
    "users": 10
  }
}
```
### Role Users Lists
Method `GET`
URL `{{ _.base_permission }}/role-users?role=permission-manager`
Headers:
```json=
{
    "Authorization": Bearer <token>
}
```
Response:
`status_code: 200`
```json=
{
  "message": "success",
  "success": true,
  "data": {
    "count": 1,
    "users": [
      {
        "block_history": [
          {
            "block_reason": "blocked from HRM",
            "blocked_by": "priota",
            "time": "2021-04-07T10:47:14.564Z"
          },
          {
            "time": "2021-04-07T11:13:59.947Z",
            "unblock_reason": "sjfdkjsa",
            "unblocked_by": "ttoma"
          }
        ],
        "contact": "013248234..",
        "created_at": "2019-08-29T12:10:39Z",
        "date_joined": "2019-08-29T12:10:38Z",
        "email": "some@email.net",
        "first_name": "Ishak",
        "gender": "male",
        "groups": [
          "AccountsManager",
          "CampaignAdmin",
          "CampaignManager",
          "EfoodContentAdmin",
          "EfoodManager",
          "VoucherViewer",
          "IssueResolutionManager",
          "NoteEntry",
          "EfoodCustomerService",
          "ChatManager",
          "IssueResolutionAdmin",
          "RefundManager",
          "ShopAdmin",
          "NoteManager",
          "VoucherManager",
          "BalanceManager",
          "AppointmentAdmin",
          "NotificationManager",
          "ebazarManager",
          "EkhataAdmin",
          "CashbackAdmin",
          "EfoodAdmin",
          "EfoodContentManager",
          "OrderStatusUpdate",
          "AccountsAdmin",
          "DataExporter",
          "EvalyEmployee",
          "OrderManager",
          "OrderCancel",
          "BrandManager",
          "ProductAdmin",
          "VoucherAdmin",
          "BulkAdmin",
          "ProductManager",
          "ebazarAdmin",
          "TechSupport",
          "BulkPermission",
          "ShopManager",
          "CategoryManager",
          "ChatAdmin",
          "OrderAdmin",
          "HeroManager",
          "ShopOwner",
          "TechAdmin",
          "CompanyAdmin",
          "CompanyManager",
          "EjobsEvalyAdmin",
          "HRManager",
          "EmployeeManager",
          "AssetManager",
          "HRAdmin",
          "HeroAdmin",
          "TeamManager",
          "EpayAdmin"
        ],
        "is_active": true,
        "is_staff": true,
        "is_superuser": true,
        "last_login": "2021-01-18T07:41:12.223Z",
        "last_name": "Ahammed",
        "profile_pic_url": "https://s3-ap-southeast-1.amazonaws.com/media.evaly.com.bd/media/images/1573e2c486ec-newfile.jpeg",
        "role": "606a9d92210d21feda840bcc",
        "updated_at": "2021-05-21T14:45:12.38Z",
        "updated_by": "tripping_card",
        "user_status": "active",
        "user_type": "employee",
        "username": "ishak",
        "verified": true
      }
    ]
  }
}
```
### Update Role
Method `PATCH`
URL: `{{ _.base_permission }}/update-role`
Headers:
```json=
{
    "Authorization": Bearer <token>
}
```
Request Body
```json=
{
	"name": "Category Managerr",
	"slug": "category-manager",
	"description": "This is a role to assign a user",
	"status": "active"
}
```
Response:
`status_code: 200`
```json=
{
  "message": "success",
  "success": true,
  "data": {
    "name": "category managerr",
    "slug": "category-manager",
    "id": "",
    "description": "This is a role to assign a user",
    "status": "active",
    "created_by": "ishak",
    "updated_by": "ishak",
    "users": 0
  }
}
```
### Update Role Actions
Method `PUT`
URL: `{{ _.base_permission }}/update-role-actions/<role_slug>`
Headers:
```json=
{
    "Authorization": Bearer <token>
}
```
Request Body
```json=
{
	"platform_slug": "ehealth",
	"module_slug": "brand",
	"actions": [
		{
			"slug": "create-brand",
			"checked": true
		},
		{
			"slug": "export-brands",
			"checked": true
		},
		{
			"slug": "update-brand-details",
			"checked": true
		},
		{
			"slug": "update-brand-status",
			"checked": true
		},
		{
			"slug": "view-brand",
			"checked": true
		},
		{
			"slug": "view-brand-history",
			"checked": true
		}
	]
}
```
Response:
`status_code: 200`
```json=
{
  "message": "actions saved against the specified role successfully",
  "success": true
}
```
### Assign Role
Method `POST`
URL: `{{ _.base_permission }}/assign-role`
Headers:
```json=
{
    "Authorization": Bearer <token>
}
```
Request Body
```json=
{
	"usernames": ["category1"],
	"role": "category-manager"
}
```
Response:
`status_code: 200`
```json=
{
  "message": "Role assigned successfully",
  "success": true,
  "data": null
}
```
### View Role's Actions
Method `GET`
URL `{{ _.base_permission }}/fe/role-actions?platform=ehealth&role=ehealthpatientmanager`
Headers:
```json=
{
    "Authorization": Bearer <token>
}
```
Response:
`status_code: 200`
```json=
{
  "message": "success",
  "success": true,
  "data": {
    "platform_name": "ehealth",
    "platform_slug": "ehealth",
    "modules": [
      {
        "module_name": "patient",
        "module_slug": "patient",
        "actions": [
          {
            "action_name": "view.medical.records",
            "action_slug": "view-medical-records",
            "checked": true
          },
          {
            "action_name": "view.user",
            "action_slug": "view-user",
            "checked": true
          }
        ]
      }
    ]
  }
}
```
### View User Actions
Method `GET`
URL `{{ _.base_permission }}/user-actions/ishak`
Headers:
```json=
{
    "Authorization": Bearer <token>
}
```
Response:
`status_code: 200`
```json=
{
  "message": "success",
  "success": true,
  "data": []
}
```
### View Own Actions
Method `GET`
URL `{{ _.base_permission }}/fe/all-actions`
Headers:
```json=
{
    "Authorization": Bearer <token>
}
```
Response:
`status_code: 200`
```json=
{
  "message": "success",
  "success": true,
  "data": [
    {
      "platform_name": "ehealth",
      "platform_slug": "ehealth",
      "module_name": "patient",
      "module_slug": "patient",
      "action_name": "view.medical.records",
      "action_slug": "view-medical-records",
      "checked": true
    },
    {
      "platform_name": "ehealth",
      "platform_slug": "ehealth",
      "module_name": "patient",
      "module_slug": "patient",
      "action_name": "view.user",
      "action_slug": "view-user",
      "checked": true
    }
  ]
}
```
### Remove Role
Method `DELETE`
URL: `{{ _.base_permission }}/remove-role`
Headers:
```json=
{
    "Authorization": Bearer <token>
}
```
Request Body
```json=
{
	"username": "navid"
}
```
Response:
`status_code: 200`
```json=
{
  "message": "successful",
  "success": true,
  "data": null
}
```
