Devtron Policy Management API

Endpoints for managing policies.

OpenAPI Specification

devtron-policy-management-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  version: 1.0.0
  title: Devtron APIs Specs Applications Policy Management API
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  description: Application management operations including creation, listing, and updates
servers:
- url: http://localhost/orchestrator
  description: Local development server
tags:
- name: Policy Management
  description: Endpoints for managing policies.
  x-displayName: Policy Management
paths:
  /admin/policy/default:
    post:
      tags:
      - Policy Management
      summary: Add Default Policy and Roles
      operationId: AddDefaultPolicyAndRoles
      description: Creates default policies and roles based on team, app, and environment. This is a specialized endpoint.
      parameters:
      - name: token
        in: header
        required: true
        description: Authentication token.
        schema:
          type: string
      - name: team
        in: query
        required: true
        description: Project Id
        schema:
          type: string
      - name: app
        in: query
        required: true
        description: Application Id
        schema:
          type: string
      - name: env
        in: query
        required: true
        description: Environment Id
        schema:
          type: string
      responses:
        '200':
          description: Default policies and roles added successfully.
        '400':
          $ref: '#/components/responses/BadRequest'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security: []
  /user/sync/orchestratortocasbin:
    get:
      tags:
      - Policy Management
      summary: Sync Orchestrator to Casbin
      operationId: SyncOrchestratorToCasbin
      description: Synchronizes policies from orchestrator to Casbin. Requires admin privileges.
      responses:
        '200':
          description: Sync status.
          content:
            application/json:
              schema:
                type: boolean
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security: []
  /user/update/trigger/terminal:
    put:
      tags:
      - Policy Management
      summary: Update Trigger Policy for Terminal Access
      operationId: UpdateTriggerPolicyForTerminalAccess
      description: Updates trigger policies related to terminal access. Requires global update privileges.
      responses:
        '200':
          description: Policy update status.
          content:
            application/json:
              schema:
                type: string
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security: []
components:
  responses:
    Forbidden:
      description: Forbidden. User does not have permission.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerError:
      description: Internal server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    BadRequest:
      description: Bad request. Invalid input parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Unauthorized. User is not logged in or token is invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  schemas:
    ErrorResponse:
      type: object
      properties:
        code:
          type: integer
          format: int32
        status:
          type: string
        result:
          type: object
          nullable: true
        errors:
          type: array
          items:
            type: object
            properties:
              userMessage:
                type: string
                nullable: true
              internalMessage:
                type: string
                nullable: true
x-tagGroups:
- name: Common Devtron automation APIs
  tags:
  - Metadata
  - Jobs
  - Helm Charts
  - List Applications
  - Applications
  - Labels
  - bulk_other
  - BulkUpdate
  - SSO Configuration
  - User Management
  - Role Group Management
  - RBAC
  - Authentication
  - Policy Management
  - Cache Management
  - Cluster Environment
  - Cluster Management
  - Environment Management
  - Change Chart
  - Clone Workflow
  - Deployment History
  - K8s Resource
  - Resource Recommendation
  - Workflow Management
  - Devtron Server version
  - GitOps Validation
  - Notifications