Role

Define roles and assign permissions.

Get organizations roles

get
/organizations/{organizationId}/roles

Get organizations roles by organization user

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
organizationIdstringRequired

Entity ID

Pattern: ^[0-9a-fA-F]{24}$
Query parameters
limitintegerOptional

The limit of per page

Default: 10
pageintegerOptional

Current page number

Default: 1
sortstringOptional

Sort

Example: {"value":"createdAt"}
textstringOptional

Text

privilegesstringOptional

Privileges

Responses
200

OK

application/json
Responseall of
and
get
/organizations/{organizationId}/roles
GET /api/v1/organizations/{organizationId}/roles HTTP/1.1
Host: abp-api.akinon.net
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "totalDocs": 1,
  "limit": 10,
  "page": 1,
  "totalPages": 1,
  "pagingCounter": 1,
  "hasPrevPage": true,
  "hasNextPage": true,
  "prevPage": 1,
  "nextPage": 1,
  "docs": []
}

Create a organization role

post
/organizations/{organizationId}/roles

Create a organization role by organization user

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
organizationIdstringRequired

Entity ID

Pattern: ^[0-9a-fA-F]{24}$
Body
namestringOptional

Role name

Example: <name>
descriptionstringOptional

Role description

Example: <description>
privilegesstring[]Optional

Role privileges

Example: ["all:user:write"]
statusnumberOptional

Role status

Example: <status>
Responses
post
/organizations/{organizationId}/roles
POST /api/v1/organizations/{organizationId}/roles HTTP/1.1
Host: abp-api.akinon.net
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 101

{
  "name": "<name>",
  "description": "<description>",
  "privileges": [
    [
      "all:user:write"
    ]
  ],
  "status": "<status>"
}
{
  "_id": "text",
  "organization": "text",
  "name": "text",
  "privileges": [
    "text"
  ],
  "status": 1,
  "createdAt": "2025-12-06T05:53:20.791Z",
  "updatedAt": "2025-12-06T05:53:20.791Z"
}

Get a organization role

get
/organizations/{organizationId}/roles/{roleId}

Get a organization role by organization user

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
organizationIdstringRequired

Entity ID

Pattern: ^[0-9a-fA-F]{24}$
roleIdstringRequired

Entity ID

Pattern: ^[0-9a-fA-F]{24}$
Responses
200

OK

application/json
get
/organizations/{organizationId}/roles/{roleId}
GET /api/v1/organizations/{organizationId}/roles/{roleId} HTTP/1.1
Host: abp-api.akinon.net
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "_id": "text",
  "name": "text",
  "description": "text",
  "organization": {
    "_id": "text",
    "name": "text",
    "slug": "text",
    "description": "text",
    "owner": "text",
    "isExecutive": false,
    "status": 0,
    "privileges": [
      "project:read",
      "project:write"
    ],
    "imageUrl": "text",
    "createdAt": "2025-12-06T05:53:20.791Z",
    "updatedAt": "2025-12-06T05:53:20.791Z"
  },
  "privileges": [
    "project:read",
    "project:write"
  ],
  "createdAt": "2025-12-06T05:53:20.791Z",
  "updatedAt": "2025-12-06T05:53:20.791Z"
}

Update a organization role

put
/organizations/{organizationId}/roles/{roleId}

Update a organization role by organization user

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
organizationIdstringRequired

Entity ID

Pattern: ^[0-9a-fA-F]{24}$
roleIdstringRequired

Entity ID

Pattern: ^[0-9a-fA-F]{24}$
Body
namestringOptional

Role name

Example: <name>
descriptionstringOptional

Role description

Example: <description>
privilegesstring[]Optional

Role privileges

Example: ["all:user:write"]
statusnumberOptional

Role status

Example: <status>
Responses
200

OK

application/json
put
/organizations/{organizationId}/roles/{roleId}
PUT /api/v1/organizations/{organizationId}/roles/{roleId} HTTP/1.1
Host: abp-api.akinon.net
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 101

{
  "name": "<name>",
  "description": "<description>",
  "privileges": [
    [
      "all:user:write"
    ]
  ],
  "status": "<status>"
}
{
  "_id": "text",
  "name": "text",
  "description": "text",
  "organization": {
    "_id": "text",
    "name": "text",
    "slug": "text",
    "description": "text",
    "owner": "text",
    "isExecutive": false,
    "status": 0,
    "privileges": [
      "project:read",
      "project:write"
    ],
    "imageUrl": "text",
    "createdAt": "2025-12-06T05:53:20.791Z",
    "updatedAt": "2025-12-06T05:53:20.791Z"
  },
  "privileges": [
    "project:read",
    "project:write"
  ],
  "createdAt": "2025-12-06T05:53:20.791Z",
  "updatedAt": "2025-12-06T05:53:20.791Z"
}

Delete a organization role

delete
/organizations/{organizationId}/roles/{roleId}

Delete a organization role by organization user

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
organizationIdstringRequired

Entity ID

Pattern: ^[0-9a-fA-F]{24}$
roleIdstringRequired

Entity ID

Pattern: ^[0-9a-fA-F]{24}$
Responses
delete
/organizations/{organizationId}/roles/{roleId}
DELETE /api/v1/organizations/{organizationId}/roles/{roleId} HTTP/1.1
Host: abp-api.akinon.net
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Last updated

Was this helpful?