Tyk

Tyk Open Policy Agent API

The Tyk Dashboard permission system can be extended by writing custom rules using an Open Policy Agent (OPA). The rules engine works on top of your Dashboard API, which means you can control not only access rules, but also behaviour of all Dashboard APIs (except your public developer portal) By default the Dashboard OPA engine is turned off, and you need to explicitly enable it via your Dashboard tyk_analytics.conf file. You can use OPA rule to accomplish tasks like: 1. Prevent users from creating keyless APIs. 2. Assign specific categories to APIs created to certain user groups or users. 3. Control access for individual fields. For example, do not allow changing the API active status (e.g. deploy), unless you have a specific permission set. 4. And many more [Read more about Tyk Open Policy Agent here](https://tyk.io/docs/tyk-dashboard/open-policy-agent/)

Operations 2

GET /api/org/opa List OPA rules #
PUT /api/org/opa Update OPA rules #

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/tyk-open-policy-agent-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

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. See our Privacy Policy and Terms.

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

OpenAPI Specification

tyk-open-policy-agent-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  contact:
    email: support@tyk.io
    name: Tyk Technologies
    url: https://tyk.io/contact
  description: '## Introduction


    The Tyk Dashboard API offers granular, programmatic access to a centralised database of resources that your Tyk nodes can pull from.'
  license:
    name: Mozilla Public License Version 2.0
    url: https://github.com/TykTechnologies/tyk/blob/master/LICENSE.md
  title: Tyk Dashboard Open Policy Agent API
  version: 5.7.1
servers:
- url: https://{tenant}
  variables:
    tenant:
      default: localhost:8080
      description: Your dashboard host
security:
- bearerAuth: []
tags:
- description: The Tyk Dashboard permission system can be extended by writing custom rules using an Open Policy Agent (OPA).
  externalDocs:
    description: Tyk Open Policy Agent Full Documentation.
    url: https://tyk.io/docs/tyk-dashboard/open-policy-agent/
  name: Open Policy Agent
paths:
  /api/org/opa:
    get:
      description: List your organisation OPA rules.
      operationId: getOPARules
      responses:
        '200':
          content:
            application/json:
              example:
                open_policy:
                  rules: "package dashboard_users\ndefault request_intent = \"read\"\nrequest_intent = \"write\" { input.request.method == \"POST\" }\nrequest_intent = \"write\" { input.request.method == \"PUT\" }\nrequest_intent = \"delete\" { input.request.method == \"DELETE\" }\ndeny[\"You cannot create a keyless API.\"] {\n    request_intent == \"write\"\n    contains(input.request.path, \"api/apis\")\n    input.request.body.api_definition.use_keyless == true\n}"
              schema:
                $ref: '#/components/schemas/NewOPARules'
          description: OPA rules fetched.
        '401':
          content:
            application/json:
              example:
                Message: Not authorised
                Meta: null
                Status: Error
              schema:
                $ref: '#/components/schemas/ApiResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              example:
                Message: Your license does not support Open Policy.
                Meta: null
                Status: Error
              schema:
                $ref: '#/components/schemas/ApiResponse'
          description: Upgrade licence.
        '500':
          content:
            application/json:
              example:
                Message: Failed to identify organisation.
                Meta: null
                Status: Error
              schema:
                $ref: '#/components/schemas/ApiResponse'
          description: Internal server error.
      summary: List OPA rules
      tags:
      - Open Policy Agent
    put:
      description: Modify your OPA rules.
      operationId: updateOrgOPARules
      requestBody:
        content:
          application/json:
            example:
              open_policy:
                rules: "package dashboard_users\ndefault request_intent = \"read\"\nrequest_intent = \"write\" { input.request.method == \"POST\" }\nrequest_intent = \"write\" { input.request.method == \"PUT\" }\nrequest_intent = \"delete\" { input.request.method == \"DELETE\" }\ndeny[\"You cannot create a keyless API.\"] {\n    request_intent == \"write\"\n    contains(input.request.path, \"api/apis\")\n    input.request.body.api_definition.use_keyless == true\n}"
            schema:
              $ref: '#/components/schemas/NewOPARules'
        description: Create rule to prevent creation of keyless APIs.
      responses:
        '200':
          content:
            application/json:
              example:
                Message: OPA rules has been updated on org level.
                Meta: null
                Status: OK
              schema:
                $ref: '#/components/schemas/ApiResponse'
          description: OPA rules updated.
        '400':
          content:
            application/json:
              example:
                Message: Invalid OPA rules.
                Meta: null
                Status: Error
              schema:
                $ref: '#/components/schemas/ApiResponse'
          description: Invalid OPA rules.
        '401':
          content:
            application/json:
              example:
                Message: Not authorised
                Meta: null
                Status: Error
              schema:
                $ref: '#/components/schemas/ApiResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              example:
                Message: Your license does not support Open Policy.
                Meta: null
                Status: Error
              schema:
                $ref: '#/components/schemas/ApiResponse'
          description: Upgrade licence.
        '500':
          content:
            application/json:
              example:
                Message: Failed to unmarshal response body.
                Meta: null
                Status: Error
              schema:
                $ref: '#/components/schemas/ApiResponse'
          description: malformed request body.
      summary: Update OPA rules
      tags:
      - Open Policy Agent
components:
  schemas:
    NewOPARules:
      properties:
        open_policy:
          properties:
            rules:
              type: string
          type: object
      type: object
    ApiResponse:
      properties:
        ID:
          type: string
        Message:
          type: string
        Meta: {}
        Status:
          type: string
      type: object
  securitySchemes:
    bearerAuth:
      description: The Tyk Dashboard API Access Credentials
      scheme: bearer
      type: http