Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save pushpabrol/c98ede552d224f869662efccbef0708a to your computer and use it in GitHub Desktop.

Select an option

Save pushpabrol/c98ede552d224f869662efccbef0708a to your computer and use it in GitHub Desktop.
{
"info": {
"name": "Roles and Permissions Mgmgt API v2",
"_postman_id": "2073276d-fae4-6190-6158-5aa87d79fd80",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Get Roles",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{auth0_api_v2_token}}"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "https://{{auth0_domain}}/api/v2/roles",
"protocol": "https",
"host": [
"{{auth0_domain}}"
],
"path": [
"api",
"v2",
"roles"
]
}
},
"response": []
},
{
"name": "Get Role by Id",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{auth0_api_v2_token}}"
}
],
"body": {},
"url": {
"raw": "https://{{auth0_domain}}/api/v2/roles/rol_lhrArX5ipNnUXoKh",
"protocol": "https",
"host": [
"{{auth0_domain}}"
],
"path": [
"api",
"v2",
"roles",
"rol_lhrArX5ipNnUXoKh"
]
}
},
"response": []
},
{
"name": "Update a role",
"request": {
"method": "PATCH",
"header": [
{
"key": "Authorization",
"value": "Bearer {{auth0_api_v2_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"name\": \"test\",\n \"description\": \"123\"\n}"
},
"url": {
"raw": "https://{{auth0_domain}}/api/v2/roles/rol_lhrArX5ipNnUXoKh",
"protocol": "https",
"host": [
"{{auth0_domain}}"
],
"path": [
"api",
"v2",
"roles",
"rol_lhrArX5ipNnUXoKh"
]
}
},
"response": []
},
{
"name": "Delete a role",
"request": {
"method": "DELETE",
"header": [
{
"key": "Authorization",
"value": "Bearer {{auth0_api_v2_token}}"
}
],
"body": {},
"url": {
"raw": "https://{{auth0_domain}}/api/v2/roles/rol_lhrArX5ipNnUXoKh",
"protocol": "https",
"host": [
"{{auth0_domain}}"
],
"path": [
"api",
"v2",
"roles",
"rol_lhrArX5ipNnUXoKh"
]
}
},
"response": []
},
{
"name": "Create a role",
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{auth0_api_v2_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"name\": \"test1\",\n \"description\": \"123\"\n}"
},
"url": {
"raw": "https://{{auth0_domain}}/api/v2/roles",
"protocol": "https",
"host": [
"{{auth0_domain}}"
],
"path": [
"api",
"v2",
"roles"
]
}
},
"response": []
},
{
"name": "Get Users in a role",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{auth0_api_v2_token}}"
}
],
"body": {},
"url": {
"raw": "https://{{auth0_domain}}/api/v2/roles/rol_lhrArX5ipNnUXoKh/users",
"protocol": "https",
"host": [
"{{auth0_domain}}"
],
"path": [
"api",
"v2",
"roles",
"rol_lhrArX5ipNnUXoKh",
"users"
]
}
},
"response": []
},
{
"name": "Get roles assigned to a user",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{auth0_api_v2_token}}"
}
],
"body": {},
"url": {
"raw": "https://{{auth0_domain}}/api/v2/users/auth0|5bf4355efb26723186b20153/roles",
"protocol": "https",
"host": [
"{{auth0_domain}}"
],
"path": [
"api",
"v2",
"users",
"auth0|5bf4355efb26723186b20153",
"roles"
]
}
},
"response": []
},
{
"name": "Assign roles to a user",
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{auth0_api_v2_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{ \"roles\" : [\"rol_RuMnH9zoMm4BfU7S\"]}"
},
"url": {
"raw": "https://{{auth0_domain}}/api/v2/users/auth0|5bf165c1fb26723186b2014f/roles",
"protocol": "https",
"host": [
"{{auth0_domain}}"
],
"path": [
"api",
"v2",
"users",
"auth0|5bf165c1fb26723186b2014f",
"roles"
]
}
},
"response": []
},
{
"name": "Remove roles from a user",
"request": {
"method": "DELETE",
"header": [
{
"key": "Authorization",
"value": "Bearer {{auth0_api_v2_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{ \"roles\" : [\"rol_lhrArX5ipNnUXoKh\"]}"
},
"url": {
"raw": "https://{{auth0_domain}}/api/v2/users/auth0|5bf165c1fb26723186b2014f/roles",
"protocol": "https",
"host": [
"{{auth0_domain}}"
],
"path": [
"api",
"v2",
"users",
"auth0|5bf165c1fb26723186b2014f",
"roles"
]
}
},
"response": []
},
{
"name": "Add permission to role",
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{auth0_api_v2_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{ \"permissions\" : [{\"permission_name\" :\"do:something\" ,\"resource_server_identifier\" :\"test123\" }]}"
},
"url": {
"raw": "https://{{auth0_domain}}/api/v2/roles/rol_PqWi6xUVCTev7ktu/permissions",
"protocol": "https",
"host": [
"{{auth0_domain}}"
],
"path": [
"api",
"v2",
"roles",
"rol_PqWi6xUVCTev7ktu",
"permissions"
]
}
},
"response": []
},
{
"name": "remove permission from a role",
"request": {
"method": "DELETE",
"header": [
{
"key": "Authorization",
"value": "Bearer {{auth0_api_v2_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{ \"permissions\" : [{\"permission_name\" :\"do:something\" ,\"resource_server_identifier\" :\"test123\" }]}"
},
"url": {
"raw": "https://{{auth0_domain}}/api/v2/roles/rol_lhrArX5ipNnUXoKh/permissions",
"protocol": "https",
"host": [
"{{auth0_domain}}"
],
"path": [
"api",
"v2",
"roles",
"rol_lhrArX5ipNnUXoKh",
"permissions"
]
}
},
"response": []
},
{
"name": "Get permissions in a role",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{auth0_api_v2_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{ \"permissions\" : [{\"permission_name\" :\"do:something\" ,\"resource_server_identifier\" :\"test123\" }]}"
},
"url": {
"raw": "https://{{auth0_domain}}/api/v2/roles/rol_lhrArX5ipNnUXoKh/permissions",
"protocol": "https",
"host": [
"{{auth0_domain}}"
],
"path": [
"api",
"v2",
"roles",
"rol_lhrArX5ipNnUXoKh",
"permissions"
]
}
},
"response": []
},
{
"name": "Create permissions directly for a user",
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{auth0_api_v2_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{ \"permissions\" : [{\"permission_name\" :\"do:something\" ,\"resource_server_identifier\" :\"test123\" }]}"
},
"url": {
"raw": "https://{{auth0_domain}}/api/v2/users/auth0|5bf4355efb26723186b20153/permissions",
"protocol": "https",
"host": [
"{{auth0_domain}}"
],
"path": [
"api",
"v2",
"users",
"auth0|5bf4355efb26723186b20153",
"permissions"
]
}
},
"response": []
},
{
"name": "Delete permissions directly from a user",
"request": {
"method": "DELETE",
"header": [
{
"key": "Authorization",
"value": "Bearer {{auth0_api_v2_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{ \"permissions\" : [{\"permission_name\" :\"do:something\" ,\"resource_server_identifier\" :\"test123\" }]}"
},
"url": {
"raw": "https://{{auth0_domain}}/api/v2/users/auth0|5bf4355efb26723186b20153/permissions",
"protocol": "https",
"host": [
"{{auth0_domain}}"
],
"path": [
"api",
"v2",
"users",
"auth0|5bf4355efb26723186b20153",
"permissions"
]
}
},
"response": []
},
{
"name": "Get the permissions assigned to a user",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{auth0_api_v2_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{ \"permissions\" : [{\"permission_name\" :\"do:something\" ,\"resource_server_identifier\" :\"test123\" }]}"
},
"url": {
"raw": "https://{{auth0_domain}}/api/v2/users/auth0|5bf165c1fb26723186b2014f/permissions",
"protocol": "https",
"host": [
"{{auth0_domain}}"
],
"path": [
"api",
"v2",
"users",
"auth0|5bf165c1fb26723186b2014f",
"permissions"
]
}
},
"response": []
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment