Skip to Content
Docs
API referenceManagement API

Resource types

List resource types

GET
/authz/resource-types

List the instance's resource types: the reserved root and org types (org in b2b instances only), and the custom types.

Authorization

headerx-pontive-instance-id<token>

Instance ID for the request

Query Parameters

page?integer

Page number

limit?integer

Items per page

sort?string

Sort field; prefix with - for descending (e.g. -created_at). Allowed: created_at, updated_at, name, key. Default: -created_at

Response Body

OK

application/json
  1. response
data?array<>
object?string
pagination?

Pagination is the page answered (api-route-review D9).

Example Request
curl -X GET 'https://api.us.pontive.com/v1/authz/resource-types'
Example Response
{  "data": [    {      "created_at": "string",      "description": "string",      "instance_id": "string",      "key": "string",      "name": "string",      "object": "string",      "parents": [        "string"      ],      "policy": {        "allow_members_to_leave": true,        "invitation_expiry_days": 0,        "roles_on_join": [          "string"        ]      },      "reserved": true,      "updated_at": "string"    }  ],  "object": "string",  "pagination": {    "limit": 0,    "page": 0,    "total": 0,    "total_pages": 0  }}

Create resource type

POST
/authz/resource-types

Register a resource type in the instance's registry. Only custom types can be created: root and org are reserved and seeded.

Authorization

headerx-pontive-instance-id<token>

Instance ID for the request

Request Body

Create Resource Type Request

application/json
  1. body

Create Resource Type Request

allow_members_to_leave?boolean

The membership policy. Roles on join are set once the type's roles exist.

description?string
invitation_expiry_days?integer
key*string
name?string
parents?array<string>

The parent type keys: at least one (parents_required). The type's shortest chain of parent types from root or org, self-references aside, is at most 8 levels (max_depth_exceeded) and must exist (cycle_detected): deeper, or with no chain, no resource of the type could ever be registered.

Response Body

Created

application/json
  1. response
created_at?string
description?string
instance_id?string
key?string
name?string
object?string
parents?array<string>

Parents are the types this type's objects may sit under: at least one on every type but root. Each is one edge, whose relation in the authorization model is the parent's key.

policy?

Policy is a custom type's membership policy; defaults on the reserved types.

reserved?boolean

Reserved is true for the seeded root and org types: they cannot be deleted, and only their name and description change.

updated_at?string
Example Request
curl -X POST 'https://api.us.pontive.com/v1/authz/resource-types' \  -H 'Content-Type: application/json' \  -d '{  "key": "string"}'
Example Response
{  "created_at": "string",  "description": "string",  "instance_id": "string",  "key": "string",  "name": "string",  "object": "string",  "parents": [    "string"  ],  "policy": {    "allow_members_to_leave": true,    "invitation_expiry_days": 0,    "roles_on_join": [      "string"    ]  },  "reserved": true,  "updated_at": "string"}

Get resource type

GET
/authz/resource-types/{resource_type}

Get a resource type by its key.

Authorization

headerx-pontive-instance-id<token>

Instance ID for the request

Path Parameters

resource_type*string

Resource type key

Response Body

OK

application/json
  1. response
created_at?string
description?string
instance_id?string
key?string
name?string
object?string
parents?array<string>

Parents are the types this type's objects may sit under: at least one on every type but root. Each is one edge, whose relation in the authorization model is the parent's key.

policy?

Policy is a custom type's membership policy; defaults on the reserved types.

reserved?boolean

Reserved is true for the seeded root and org types: they cannot be deleted, and only their name and description change.

updated_at?string
Example Request
curl -X GET 'https://api.us.pontive.com/v1/authz/resource-types/string'
Example Response
{  "created_at": "string",  "description": "string",  "instance_id": "string",  "key": "string",  "name": "string",  "object": "string",  "parents": [    "string"  ],  "policy": {    "allow_members_to_leave": true,    "invitation_expiry_days": 0,    "roles_on_join": [      "string"    ]  },  "reserved": true,  "updated_at": "string"}

Update resource type

PATCH
/authz/resource-types/{resource_type}

Update a resource type. Cannot update: key (immutable). The reserved root and org types accept only name and description.

Authorization

headerx-pontive-instance-id<token>

Instance ID for the request

Path Parameters

resource_type*string

Resource type key

Header Parameters

If-Match?string

The ETag the document was read with: a stale one is refused 412 precondition_failed (D42)

Request Body

Update Resource Type Request

application/json
  1. body

Update Resource Type Request

allow_members_to_leave?boolean

The membership policy fields; each omitted is left unchanged.

description?string
invitation_expiry_days?integer

0 clears it to the instance's.

name?string
parents?array<string>

Replaces the parent type keys when present; an empty list is refused (parents_required), a type never loses its last parent type. The new set must leave this type, and every type under it, within 8 levels of root or org (max_depth_exceeded) and with a chain of parent types to root (cycle_detected).

roles_on_join?array<string>

Response Body

OK

application/json
  1. response
created_at?string
description?string
instance_id?string
key?string
name?string
object?string
parents?array<string>

Parents are the types this type's objects may sit under: at least one on every type but root. Each is one edge, whose relation in the authorization model is the parent's key.

policy?

Policy is a custom type's membership policy; defaults on the reserved types.

reserved?boolean

Reserved is true for the seeded root and org types: they cannot be deleted, and only their name and description change.

updated_at?string
Example Request
curl -X PATCH 'https://api.us.pontive.com/v1/authz/resource-types/string' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "created_at": "string",  "description": "string",  "instance_id": "string",  "key": "string",  "name": "string",  "object": "string",  "parents": [    "string"  ],  "policy": {    "allow_members_to_leave": true,    "invitation_expiry_days": 0,    "roles_on_join": [      "string"    ]  },  "reserved": true,  "updated_at": "string"}

Delete resource type

DELETE
/authz/resource-types/{resource_type}

Delete a resource type from the registry by its key. The reserved root and organization types cannot be deleted.

Authorization

headerx-pontive-instance-id<token>

Instance ID for the request

Path Parameters

resource_type*string

Resource type key

Header Parameters

If-Match?string

The ETag the document was read with: a stale one is refused 412 precondition_failed (D42)

Response Body

No Content

Example Request
curl -X DELETE 'https://api.us.pontive.com/v1/authz/resource-types/string'
Example Response
Empty