Resources

Lists all the resources defined in your schema.

get/v2/schema/{proj_id}/{env_id}/resources

Request

  • Base URL
    https://api.permit.io (the document declares no server; this is the origin it was published from)
  • Auth
    HTTP bearer

Path parameters

proj_idstring required

Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug").

env_idstring required

Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug").

Query parameters

include_built_inboolean

Whether to include or exclude built-in resources, default is False

include_total_countboolean

Include total count in response

pageinteger

Page number of the results to fetch, starting at 1.

per_pageinteger

The number of results per page (max 100).

searchstring

Text search for the object name or key

Response

Successful Response

OR

Example response

{
  "data": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",
      "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9",
      "environment_id": "40ef0e48-a11f-4963-a229-e396c9f7e7c4",
      "created_at": "2019-08-24T14:15:22Z",
      "updated_at": "2019-08-24T14:15:22Z",
      "key": "repository",
      "name": "Repository",
      "urn": "prn:github:scm:repository",
      "description": "a git repository stored on github",
      "actions": {
        "clone": {
          "id": "90e21d70-2b1b-42f0-b492-8fd69c1d79d1"
        },
        "read": {
          "id": "2bc27751-6115-43c0-b68c-928cb46e34bc"
        },
        "push": {
          "id": "e06da336-6e03-41d6-a495-40b0d7537b2a"
        }
      },
      "roles": {
        "maintainer": {
          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
          "key": "maintainer",
          "name": "Maintainer",
          "description": "the maintainer role can read from the repo and push changes",
          "permissions": [
            "push"
          ],
          "extends": [
            "contributor"
          ],
          "resource": "repo",
          "granted_to": {
            "id": "dba3ed53-8baf-4f5f-bf32-69f7853ef6ca",
            "users_with_role": [
              {
                "role": "Admin",
                "on_resource": "organization",
                "linked_by_relation": "owner",
                "role_id": "62ca1218-964c-4ee9-856a-7488b13d217d",
                "resource_id": "5b024f1a-1cde-420f-a8b7-03ecf16577a1",
                "relation_id": "b8544a43-faae-4f07-b7f3-8b3c0abe3dbb"
              }
            ]
          },
          "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",
          "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9",
          "environment_id": "40ef0e48-a11f-4963-a229-e396c9f7e7c4",
          "resource_id": "40ef0e48-a11f-4963-a229-e396c9f7e7dd",
          "created_at": "2019-08-24T14:15:22Z",
          "updated_at": "2019-08-24T14:15:22Z"
        }
      },
      "relations": {
        "parent": {
          "resource_id": "a86cd51d-ba64-4f98-852b-baf5ed49d422",
          "relation_name": "parent",
          "resource": "parent-resource"
        }
      },
      "attributes": {
        "created": {
          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f11",
          "type": "time",
          "description": "the time (timestamp) the repository was created"
        },
        "private": {
          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f22",
          "type": "bool",
          "description": "whether the repo is private (if false, the repo is public)"
        }
      }
    }
  ]
}

Changes