Permit.io Resource Relations API
The Resource Relations API from Permit.io, for resource relations.
The Resource Relations API from Permit.io, for resource relations.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
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.curl "https://apis.io/api/v1/apis/permitio:permitio-resource-relations-api"
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.
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: 3.2.0
info:
title: Permit.io Resource Relations API
description: Authorization as a service
version: 2.0.0
tags:
- name: Resource Relations
paths:
/v2/schema/{proj_id}/{env_id}/resources/{resource_id}/relations:
post:
tags:
- Resource Relations
summary: Create Resource Relation
description: Creates a resource relation to another resource
operationId: create_resource_relation
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/RelationCreate'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/RelationRead'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
get:
tags:
- Resource Relations
summary: List Resource Relations
description: List relations on a given resource
operationId: list_resource_relations
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:
$ref: '#/components/schemas/PaginatedResult_RelationRead_'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/v2/schema/{proj_id}/{env_id}/resources/{resource_id}/relations/{relation_id}:
get:
tags:
- Resource Relations
summary: Get Resource Relation
description: Get a resource relation
operationId: get_resource_relation
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: relation_id
in: path
required: true
schema:
type: string
description: 'Either the unique id of the relation, or the URL-friendly key of the relation (i.e: the "slug").'
title: Relation Id
description: 'Either the unique id of the relation, or the URL-friendly key of the relation (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/RelationRead'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
delete:
tags:
- Resource Relations
summary: Delete Resource Relation
description: Deletes a resource relation
operationId: delete_resource_relation
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: relation_id
in: path
required: true
schema:
type: string
description: 'Either the unique id of the relation, or the URL-friendly key of the relation (i.e: the "slug").'
title: Relation Id
description: 'Either the unique id of the relation, or the URL-friendly key of the relation (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:
RelationRead:
properties:
description:
anyOf:
- type: string
- type: 'null'
title: Description
description: An optional longer description of what this relation represents in your system
subject_resource:
type: string
title: Subject Resource
description: The subject resource ID or key
key:
type: string
title: Key
description: 'A URL-friendly name of the relation (i.e: slug). You will be able to query later using this key instead of the id (UUID) of the relation.'
name:
type: string
title: Name
description: The name of the relation
id:
type: string
format: uuid
title: Id
description: Unique id of the relation
organization_id:
type: string
format: uuid
title: Organization Id
description: Unique id of the organization that the relation belongs to.
project_id:
type: string
format: uuid
title: Project Id
description: Unique id of the project that the relation belongs to.
environment_id:
type: string
format: uuid
title: Environment Id
description: Unique id of the environment that the relation belongs to.
created_at:
type: string
format: date-time
title: Created At
description: Date and time when the relation was created (ISO_8601 format).
updated_at:
type: string
format: date-time
title: Updated At
description: Date and time when the relation was last updated/modified (ISO_8601 format).
object_resource_id:
type: string
format: uuid
title: Object Resource Id
description: The object resource id
object_resource:
type: string
title: Object Resource
description: The object resource key
subject_resource_id:
type: string
format: uuid
title: Subject Resource Id
description: The subject resource id
additionalProperties: false
type: object
required:
- subject_resource
- key
- name
- id
- organization_id
- project_id
- environment_id
- created_at
- updated_at
- object_resource_id
- object_resource
- subject_resource_id
title: RelationRead
example:
created_at: '2019-08-24T14:15:22Z'
description: parent relation
environment_id: 40ef0e48-a11f-4963-a229-e396c9f7e7c4
id: 497f6eca-6276-4993-bfeb-53cbbbba6f08
key: parent
name: parent
object_resource: repo
object_resource_id: 40ef0e48-a11f-4963-a229-e396c9f7e7dd
organization_id: 7c60d51f-b44e-4682-87d6-449835ea4de6
project_id: 405d8375-3514-403b-8c43-83ae74cfe0e9
subject_resource: organization
subject_resource_id: 40ef0e48-a11f-4963-a229-e396c9f7e7dd
updated_at: '2019-08-24T14:15:22Z'
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
PaginatedResult_RelationRead_:
properties:
data:
items:
$ref: '#/components/schemas/RelationRead'
type: array
title: Data
description: List of Relations
total_count:
type: integer
minimum: 0.0
title: Total Count
description: The number of results across all pages.
page_count:
type: integer
minimum: 0.0
title: Page Count
description: 'The number of pages at the requested `per_page`: `ceil(total_count / per_page)`. Fetch pages 1 to `page_count` to read every result. It is 0 when there are no results, and on a page past the last one.'
default: 0
additionalProperties: false
type: object
required:
- data
- total_count
title: PaginatedResult[RelationRead]
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError
RelationCreate:
properties:
key:
type: string
pattern: ^[A-Za-z0-9\-_]+$
title: Key
description: 'A URL-friendly name of the relation (i.e: slug). You will be able to query later using this key instead of the id (UUID) of the relation.'
name:
type: string
title: Name
description: The name of the relation
description:
anyOf:
- type: string
- type: 'null'
title: Description
description: An optional longer description of what this relation represents in your system
subject_resource:
type: string
title: Subject Resource
description: The subject resource ID or key
additionalProperties: false
type: object
required:
- key
- name
- subject_resource
title: RelationCreate
example:
key: parent
name: parent
subject_resource: organization
securitySchemes:
HTTPBearer:
type: http
description: 'Authorization header, we support the bearer authentication scheme (see: RFC 6750)'
scheme: bearer
bearerFormat: JWT