Ory · Capability

Ory Keto API — relationship

Ory Keto API — relationship. 6 operations. Lead operation: Delete Relationships. Self-contained Naftiko capability covering one Ory business surface.

Run with Naftiko Oryrelationship

What You Can Do

DELETE
Deleterelationships — Delete Relationships
/v1/admin/relation-tuples
PATCH
Patchrelationships — Patch Multiple Relationships
/v1/admin/relation-tuples
PUT
Createrelationship — Create a Relationship
/v1/admin/relation-tuples
GET
Listrelationshipnamespaces — Query namespaces
/v1/namespaces
POST
Checkoplsyntax — Check the syntax of an OPL file
/v1/opl/syntax/check
GET
Getrelationships — Query relationships
/v1/relation-tuples

MCP Tools

delete-relationships

Delete Relationships

idempotent
patch-multiple-relationships

Patch Multiple Relationships

idempotent
create-relationship

Create a Relationship

idempotent
query-namespaces

Query namespaces

read-only idempotent
check-syntax-opl-file

Check the syntax of an OPL file

read-only
query-relationships

Query relationships

read-only idempotent

Capability Spec

keto-relationship.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Ory Keto API — relationship
  description: 'Ory Keto API — relationship. 6 operations. Lead operation: Delete Relationships. Self-contained Naftiko capability
    covering one Ory business surface.'
  tags:
  - Ory
  - relationship
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    ORY_API_KEY: ORY_API_KEY
capability:
  consumes:
  - type: http
    namespace: keto-relationship
    baseUri: ''
    description: Ory Keto API — relationship business capability. Self-contained, no shared references.
    resources:
    - name: admin-relation-tuples
      path: /admin/relation-tuples
      operations:
      - name: deleterelationships
        method: DELETE
        description: Delete Relationships
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: namespace
          in: query
          type: string
          description: Namespace of the Relationship
        - name: object
          in: query
          type: string
          description: Object of the Relationship
        - name: relation
          in: query
          type: string
          description: Relation of the Relationship
        - name: subject_id
          in: query
          type: string
          description: SubjectID of the Relationship
        - name: subject_set.namespace
          in: query
          type: string
          description: Namespace of the Subject Set
        - name: subject_set.object
          in: query
          type: string
          description: Object of the Subject Set
        - name: subject_set.relation
          in: query
          type: string
          description: Relation of the Subject Set
      - name: patchrelationships
        method: PATCH
        description: Patch Multiple Relationships
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
      - name: createrelationship
        method: PUT
        description: Create a Relationship
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: namespaces
      path: /namespaces
      operations:
      - name: listrelationshipnamespaces
        method: GET
        description: Query namespaces
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: opl-syntax-check
      path: /opl/syntax/check
      operations:
      - name: checkoplsyntax
        method: POST
        description: Check the syntax of an OPL file
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: relation-tuples
      path: /relation-tuples
      operations:
      - name: getrelationships
        method: GET
        description: Query relationships
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: page_size
          in: query
          type: integer
          description: Items per Page
        - name: page_token
          in: query
          type: string
          description: Next Page Token
        - name: namespace
          in: query
          type: string
          description: Namespace of the Relationship
        - name: object
          in: query
          type: string
          description: Object of the Relationship
        - name: relation
          in: query
          type: string
          description: Relation of the Relationship
        - name: subject_id
          in: query
          type: string
          description: SubjectID of the Relationship
        - name: subject_set.namespace
          in: query
          type: string
          description: Namespace of the Subject Set
        - name: subject_set.object
          in: query
          type: string
          description: Object of the Subject Set
        - name: subject_set.relation
          in: query
          type: string
          description: Relation of the Subject Set
  exposes:
  - type: rest
    namespace: keto-relationship-rest
    port: 8080
    description: REST adapter for Ory Keto API — relationship. One Spectral-compliant resource per consumed operation, prefixed
      with /v1.
    resources:
    - path: /v1/admin/relation-tuples
      name: admin-relation-tuples
      description: REST surface for admin-relation-tuples.
      operations:
      - method: DELETE
        name: deleterelationships
        description: Delete Relationships
        call: keto-relationship.deleterelationships
        with:
          namespace: rest.namespace
          object: rest.object
          relation: rest.relation
          subject_id: rest.subject_id
          subject_set.namespace: rest.subject_set.namespace
          subject_set.object: rest.subject_set.object
          subject_set.relation: rest.subject_set.relation
        outputParameters:
        - type: object
          mapping: $.
      - method: PATCH
        name: patchrelationships
        description: Patch Multiple Relationships
        call: keto-relationship.patchrelationships
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: PUT
        name: createrelationship
        description: Create a Relationship
        call: keto-relationship.createrelationship
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/namespaces
      name: namespaces
      description: REST surface for namespaces.
      operations:
      - method: GET
        name: listrelationshipnamespaces
        description: Query namespaces
        call: keto-relationship.listrelationshipnamespaces
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/opl/syntax/check
      name: opl-syntax-check
      description: REST surface for opl-syntax-check.
      operations:
      - method: POST
        name: checkoplsyntax
        description: Check the syntax of an OPL file
        call: keto-relationship.checkoplsyntax
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/relation-tuples
      name: relation-tuples
      description: REST surface for relation-tuples.
      operations:
      - method: GET
        name: getrelationships
        description: Query relationships
        call: keto-relationship.getrelationships
        with:
          page_size: rest.page_size
          page_token: rest.page_token
          namespace: rest.namespace
          object: rest.object
          relation: rest.relation
          subject_id: rest.subject_id
          subject_set.namespace: rest.subject_set.namespace
          subject_set.object: rest.subject_set.object
          subject_set.relation: rest.subject_set.relation
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: keto-relationship-mcp
    port: 9090
    transport: http
    description: MCP adapter for Ory Keto API — relationship. One tool per consumed operation, routed inline through this
      capability's consumes block.
    tools:
    - name: delete-relationships
      description: Delete Relationships
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: keto-relationship.deleterelationships
      with:
        namespace: tools.namespace
        object: tools.object
        relation: tools.relation
        subject_id: tools.subject_id
        subject_set.namespace: tools.subject_set.namespace
        subject_set.object: tools.subject_set.object
        subject_set.relation: tools.subject_set.relation
      outputParameters:
      - type: object
        mapping: $.
    - name: patch-multiple-relationships
      description: Patch Multiple Relationships
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: keto-relationship.patchrelationships
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: create-relationship
      description: Create a Relationship
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: keto-relationship.createrelationship
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: query-namespaces
      description: Query namespaces
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: keto-relationship.listrelationshipnamespaces
      outputParameters:
      - type: object
        mapping: $.
    - name: check-syntax-opl-file
      description: Check the syntax of an OPL file
      hints:
        readOnly: true
        destructive: false
        idempotent: false
      call: keto-relationship.checkoplsyntax
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: query-relationships
      description: Query relationships
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: keto-relationship.getrelationships
      with:
        page_size: tools.page_size
        page_token: tools.page_token
        namespace: tools.namespace
        object: tools.object
        relation: tools.relation
        subject_id: tools.subject_id
        subject_set.namespace: tools.subject_set.namespace
        subject_set.object: tools.subject_set.object
        subject_set.relation: tools.subject_set.relation
      outputParameters:
      - type: object
        mapping: $.