Permit.io Resource Attributes API

Resource attributes allow you to specify an arbitrary schema attributes that are part of the definition of resource and must be included in any of its instances. Attributes are used to enforce attribute-based access control policies. For example, if we are building the github's permissions system, we might want to know on the `Repository` resource whether the repo is private or now. In such case we will define a boolean `private` attributes that we can now use in our policies.

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).

Operations 5

GET /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/attributes List Resource Attributes #
POST /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/attributes Create Resource Attribute #
GET /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/attributes/{attribute_id} Get Resource Attribute #
PATCH /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/attributes/{attribute_id} Update Resource Attribute #
DELETE /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/attributes/{attribute_id} Delete Resource Attribute #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/permitio:permitio-resource-attributes-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

permitio-resource-attributes-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Permit.io Resource Attributes API
  description: Authorization as a service
  version: 2.0.0
tags:
- name: Resource Attributes
  description: 'Resource attributes allow you to specify an arbitrary schema attributes that are part

    of the definition of resource and must be included in any of its instances.


    Attributes are used to enforce attribute-based access control policies.


    For example, if we are building the github''s permissions system, we might want to know

    on the `Repository` resource whether the repo is private or now. In such case we will

    define a boolean `private` attributes that we can now use in our policies.'
paths:
  /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/attributes:
    get:
      tags:
      - Resource Attributes
      summary: List Resource Attributes
      description: Lists all the attributes defined on the resource.
      operationId: list_resource_attributes
      security:
      - HTTPBearer: []
      parameters:
      - name: resource_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the "slug").'
          title: Resource Id
        description: 'Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the "slug").'
        example: my_resource
      - name: proj_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug").'
          title: Proj Id
        description: 'Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug").'
        example: my_project
      - name: env_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug").'
          title: Env Id
        description: 'Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug").'
        example: my_environment
      - name: page
        in: query
        required: false
        schema:
          type: integer
          minimum: 1
          description: Page number of the results to fetch, starting at 1.
          default: 1
          title: Page
        description: Page number of the results to fetch, starting at 1.
      - name: per_page
        in: query
        required: false
        schema:
          type: integer
          maximum: 100
          minimum: 1
          description: The number of results per page (max 100).
          default: 30
          title: Per Page
        description: The number of results per page (max 100).
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ResourceAttributeRead'
                title: Response List Resource Attributes V2 Schema  Proj Id   Env Id  Resources  Resource Id  Attributes Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
      - Resource Attributes
      summary: Create Resource Attribute
      description: Creates a new attribute as part of the resource definition.
      operationId: create_resource_attribute
      security:
      - HTTPBearer: []
      parameters:
      - name: resource_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the "slug").'
          title: Resource Id
        description: 'Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the "slug").'
        example: my_resource
      - name: proj_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug").'
          title: Proj Id
        description: 'Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug").'
        example: my_project
      - name: env_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug").'
          title: Env Id
        description: 'Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug").'
        example: my_environment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResourceAttributeCreate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceAttributeRead'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/attributes/{attribute_id}:
    get:
      tags:
      - Resource Attributes
      summary: Get Resource Attribute
      description: Gets a single attribute defined on the resource, if such attribute exists.
      operationId: get_resource_attribute
      security:
      - HTTPBearer: []
      parameters:
      - name: resource_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the "slug").'
          title: Resource Id
        description: 'Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the "slug").'
        example: my_resource
      - name: attribute_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the attribute, or the URL-friendly key of the attribute (i.e: the "slug").'
          title: Attribute Id
        description: 'Either the unique id of the attribute, or the URL-friendly key of the attribute (i.e: the "slug").'
      - name: proj_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug").'
          title: Proj Id
        description: 'Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug").'
        example: my_project
      - name: env_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug").'
          title: Env Id
        description: 'Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug").'
        example: my_environment
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceAttributeRead'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
      - Resource Attributes
      summary: Update Resource Attribute
      description: 'Partially updates the attribute defined on a resource.

        Fields that will be provided will be completely overwritten.'
      operationId: update_resource_attribute
      security:
      - HTTPBearer: []
      parameters:
      - name: resource_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the "slug").'
          title: Resource Id
        description: 'Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the "slug").'
        example: my_resource
      - name: attribute_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the attribute, or the URL-friendly key of the attribute (i.e: the "slug").'
          title: Attribute Id
        description: 'Either the unique id of the attribute, or the URL-friendly key of the attribute (i.e: the "slug").'
      - name: proj_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug").'
          title: Proj Id
        description: 'Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug").'
        example: my_project
      - name: env_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug").'
          title: Env Id
        description: 'Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug").'
        example: my_environment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResourceAttributeUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceAttributeRead'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - Resource Attributes
      summary: Delete Resource Attribute
      description: 'Deletes the attribute and all its related data.


        Note: If the attribute is used by policies, removing it will cause the

        attribute to evaluate as `undefined`.'
      operationId: delete_resource_attribute
      security:
      - HTTPBearer: []
      parameters:
      - name: resource_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the "slug").'
          title: Resource Id
        description: 'Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the "slug").'
        example: my_resource
      - name: attribute_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the attribute, or the URL-friendly key of the attribute (i.e: the "slug").'
          title: Attribute Id
        description: 'Either the unique id of the attribute, or the URL-friendly key of the attribute (i.e: the "slug").'
      - name: proj_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug").'
          title: Proj Id
        description: 'Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug").'
        example: my_project
      - name: env_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug").'
          title: Env Id
        description: 'Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug").'
        example: my_environment
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ResourceAttributeCreate:
      properties:
        key:
          type: string
          pattern: ^[A-Za-z0-9\-_]+$
          title: Key
          description: 'A URL-friendly name of the attribute (i.e: slug). You will be able to query later using this key instead of the id (UUID) of the attribute.'
        type:
          $ref: '#/components/schemas/AttributeType'
          description: 'The type of the attribute, we currently support: `bool`, `number` (ints, floats), `time` (a timestamp), `string`, and `json`.'
        description:
          anyOf:
          - type: string
          - type: 'null'
          title: Description
          description: An optional longer description of what this attribute respresents in your system
      additionalProperties: false
      type: object
      required:
      - key
      - type
      title: ResourceAttributeCreate
      example:
        description: whether or not the github repository is private
        key: private
        type: bool
    ResourceAttributeUpdate:
      properties:
        type:
          $ref: '#/components/schemas/AttributeType'
          description: 'The type of the attribute, we currently support: `bool`, `number` (ints, floats), `time` (a timestamp), `string`, and `json`.'
        description:
          anyOf:
          - type: string
          - type: 'null'
          title: Description
          description: An optional longer description of what this attribute respresents in your system
      additionalProperties: false
      type: object
      title: ResourceAttributeUpdate
      example:
        description: whether or not the github repository is private
    AttributeType:
      type: string
      enum:
      - bool
      - number
      - string
      - time
      - array
      - json
      - object
      - object_array
      title: AttributeType
      description: supported attribute primitives
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    ResourceAttributeRead:
      properties:
        type:
          $ref: '#/components/schemas/AttributeType'
          description: 'The type of the attribute, we currently support: `bool`, `number` (ints, floats), `time` (a timestamp), `string`, and `json`.'
        description:
          anyOf:
          - type: string
          - type: 'null'
          title: Description
          description: An optional longer description of what this attribute respresents in your system
        key:
          type: string
          title: Key
          description: 'A URL-friendly name of the attribute (i.e: slug). You will be able to query later using this key instead of the id (UUID) of the attribute.'
        id:
          type: string
          format: uuid
          title: Id
          description: Unique id of the attribute
        resource_id:
          type: string
          format: uuid
          title: Resource Id
          description: Unique id of the resource that the attribute belongs to.
        resource_key:
          type: string
          title: Resource Key
          description: 'A URL-friendly name of the resource (i.e: slug). You will be able to query later using this key instead of the id (UUID) of the resource.'
        organization_id:
          type: string
          format: uuid
          title: Organization Id
          description: Unique id of the organization that the attribute belongs to.
        project_id:
          type: string
          format: uuid
          title: Project Id
          description: Unique id of the project that the attribute belongs to.
        environment_id:
          type: string
          format: uuid
          title: Environment Id
          description: Unique id of the environment that the attribute belongs to.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Date and time when the attribute was created (ISO_8601 format).
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: Date and time when the attribute was last updated/modified (ISO_8601 format).
        built_in:
          type: boolean
          title: Built In
          description: Whether the attribute is built-in, and managed by the Permit system.
      additionalProperties: false
      type: object
      required:
      - type
      - key
      - id
      - resource_id
      - resource_key
      - organization_id
      - project_id
      - environment_id
      - created_at
      - updated_at
      - built_in
      title: ResourceAttributeRead
      example:
        built_in: false
        created_at: '2019-08-24T14:15:22Z'
        description: whether or not the github repository is private
        environment_id: 40ef0e48-a11f-4963-a229-e396c9f7e7c4
        id: 497f6eca-6276-4993-bfeb-53cbbbba6f08
        key: private
        organization_id: 7c60d51f-b44e-4682-87d6-449835ea4de6
        project_id: 405d8375-3514-403b-8c43-83ae74cfe0e9
        resource_id: 40ef0e48-a11f-4963-a229-e396c9f7e7dd
        resource_key: repository
        type: bool
        updated_at: '2019-08-24T14:15:22Z'
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      description: 'Authorization header, we support the bearer authentication scheme (see: RFC 6750)'
      scheme: bearer
      bearerFormat: JWT