Opal Security delegations API

Operations related to request reviewer delegations

OpenAPI Specification

opal-security-delegations-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  contact:
    email: hello@opal.dev
    name: Opal Team
    url: https://www.opal.dev/
  description: The Opal API is a RESTful API that allows you to interact with the Opal Security platform programmatically.
  title: Opal access-rules delegations API
  version: '1.0'
servers:
- description: Production
  url: https://api.opal.dev/v1
tags:
- name: delegations
  description: Operations related to request reviewer delegations
paths:
  /delegations:
    get:
      summary: Get delegations
      description: Returns a list of request reviewer delegations configured for your organization.
      operationId: getDelegations
      parameters:
      - description: The delegator user ID to filter delegations by the user delegating their access review requests.
        example: 29827fb8-f2dd-4e80-9576-28e31e9934ac
        explode: true
        in: query
        name: delegator_user_id
        required: false
        schema:
          format: uuid
          type: string
        style: form
      - description: The delegate user ID to filter delegations by the user being delegated to.
        example: 29827fb8-f2dd-4e80-9576-28e31e9934ac
        explode: true
        in: query
        name: delegate_user_id
        required: false
        schema:
          format: uuid
          type: string
        style: form
      - description: A cursor to indicate where to start fetching results.
        example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw
        explode: true
        in: query
        name: cursor
        required: false
        schema:
          type: string
        style: form
      - description: The maximum number of results to return per page. The default is 200.
        example: 200
        explode: true
        in: query
        name: page_size
        required: false
        schema:
          type: integer
          maximum: 1000
        style: form
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedDelegationsList'
          description: A list of delegations for your organization.
      security:
      - BearerAuth: []
      tags:
      - delegations
    post:
      description: Creates a new request reviewer delegation to delegate access review requests from one user to another.
      operationId: createDelegation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDelegationRequest'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Delegation'
          description: Delegation created successfully.
      security:
      - BearerAuth: []
      tags:
      - delegations
  /delegations/{delegation_id}:
    get:
      summary: Get delegation by ID
      description: Returns a specific delegation by its ID.
      operationId: getDelegation
      parameters:
      - description: The ID of the delegation to retrieve.
        example: 32acc112-21ff-4669-91c2-21e27683eaa1
        explode: true
        in: path
        name: delegation_id
        required: true
        schema:
          format: uuid
          type: string
        style: simple
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Delegation'
          description: The requested delegation.
      security:
      - BearerAuth: []
      tags:
      - delegations
    delete:
      description: Deletes a delegation by its ID.
      operationId: deleteDelegation
      parameters:
      - description: The ID of the delegation to remove.
        example: 32acc112-21ff-4669-91c2-21e27683eaa1
        explode: true
        in: path
        name: delegation_id
        required: true
        schema:
          format: uuid
          type: string
        style: simple
      responses:
        '200':
          description: Delegation removed successfully
      security:
      - BearerAuth: []
      tags:
      - delegations
components:
  schemas:
    PaginatedDelegationsList:
      type: object
      description: A list of delegations for your organization.
      properties:
        results:
          description: The delegations in the result set.
          type: array
          items:
            $ref: '#/components/schemas/Delegation'
        next:
          description: The cursor with which to continue pagination if additional result pages exist.
          example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw
          nullable: true
          type: string
        previous:
          description: The cursor used to obtain the current result page.
          example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ
          nullable: true
          type: string
        total_count:
          description: The total number of items in the result set.
          example: 2
          type: integer
    Delegation:
      type: object
      description: '# Delegation Object

        ### Description

        The `Delegation` object represents a delegation of access review requests from one user to another.


        ### Usage Example

        List from the `GET Delegations` endpoint.

        Get from the `GET Delegation` endpoint.'
      properties:
        id:
          description: The ID of the delegation.
          example: 4aed3e8a-727b-4d72-8010-3b8710c50bec
          format: uuid
          type: string
        delegator_user_id:
          description: The ID of the user delegating their access review requests.
          example: 123e4567-e89b-12d3-a456-426614174000
          format: uuid
          type: string
        delegate_user_id:
          description: The ID of the user being delegated to.
          example: 7c86c85d-0651-43e2-a748-d69d658418e8
          format: uuid
          type: string
        start_time:
          description: The start time of the delegation.
          example: 2023-10-01 12:00:00+00:00
          type: string
          format: date-time
        end_time:
          description: The end time of the delegation.
          example: 2023-10-01 12:00:00+00:00
          type: string
          format: date-time
        reason:
          description: The reason for the delegation.
          example: I need to be out of the office
          type: string
        created_at:
          description: The creation time of the delegation.
          example: 2023-10-01 12:00:00+00:00
          type: string
          format: date-time
        updated_at:
          description: The last updated time of the delegation.
          example: 2023-10-01 12:00:00+00:00
          type: string
          format: date-time
      required:
      - id
      - delegator_user_id
      - delegate_user_id
      - start_time
      - end_time
      - reason
      - created_at
      - updated_at
    CreateDelegationRequest:
      type: object
      description: Request body for creating a new delegation of access review requests from one user to another.
      properties:
        delegator_user_id:
          description: The ID of the user delegating their access review requests.
          example: 123e4567-e89b-12d3-a456-426614174000
          format: uuid
          type: string
        delegate_user_id:
          description: The ID of the user being delegated to.
          example: 7c86c85d-0651-43e2-a748-d69d658418e8
          format: uuid
          type: string
        start_time:
          description: The start time of the delegation.
          example: 2023-10-01 12:00:00+00:00
          type: string
          format: date-time
        end_time:
          description: The end time of the delegation.
          example: 2023-10-01 12:00:00+00:00
          type: string
          format: date-time
        reason:
          description: The reason for the delegation.
          example: I need to be out of the office
          type: string
      required:
      - delegator_user_id
      - delegate_user_id
      - start_time
      - end_time
      - reason
  securitySchemes:
    BearerAuth:
      scheme: bearer
      type: http