Opal Security tags API

Operations related to tags

OpenAPI Specification

opal-security-tags-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 tags API
  version: '1.0'
servers:
- description: Production
  url: https://api.opal.dev/v1
tags:
- name: tags
  description: Operations related to tags
paths:
  /tag/{tag_id}:
    get:
      summary: Get tag by ID
      description: UNSTABLE. May be removed at any time. Gets a tag with the given id.
      operationId: get_tag_by_ID
      parameters:
      - description: The tag ID
        example: 1b978423-db0a-4037-a4cf-f79c60cb67b3
        explode: false
        in: path
        name: tag_id
        required: true
        schema:
          type: string
          format: uuid
        style: simple
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tag'
          description: The tag requested.
      security:
      - BearerAuth: []
      tags:
      - tags
    delete:
      description: UNSTABLE. May be removed at any time. Deletes a tag with the given id.
      operationId: delete_tag_by_ID
      parameters:
      - description: The tag ID
        example: 1b978423-db0a-4037-a4cf-f79c60cb67b3
        explode: false
        in: path
        name: tag_id
        required: true
        schema:
          type: string
          format: uuid
        style: simple
      responses:
        '200':
          description: Tag was deleted.
      security:
      - BearerAuth: []
      tags:
      - tags
  /tag:
    get:
      description: Gets a tag with the given key and value.
      operationId: get_tag
      parameters:
      - description: The key of the tag to get.
        example: api-scope
        explode: false
        in: query
        name: tag_key
        required: true
        schema:
          type: string
        style: form
      - description: The value of the tag to get.
        example: production
        explode: false
        in: query
        name: tag_value
        required: false
        schema:
          type: string
        style: form
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tag'
          description: The tag requested.
      security:
      - BearerAuth: []
      tags:
      - tags
    post:
      description: Creates a tag with the given key and value.
      operationId: create_tag
      parameters:
      - description: The key of the tag to create.
        example: api-scope
        explode: false
        in: query
        name: tag_key
        required: false
        schema:
          type: string
        style: form
        deprecated: true
      - description: The value of the tag to create.
        example: production
        explode: false
        in: query
        name: tag_value
        required: false
        schema:
          type: string
        style: form
        deprecated: true
      - description: The ID of the owner that manages the tag.
        example: f92aa855-cea9-4814-b9d8-f2a60d3e4a06
        explode: false
        in: query
        name: admin_owner_id
        schema:
          format: uuid
          type: string
        style: form
        deprecated: true
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTagInfo'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tag'
          description: The tag that was created.
      security:
      - BearerAuth: []
      tags:
      - tags
  /tags:
    get:
      summary: Get tags
      description: Returns a list of tags created by your organization.
      operationId: getTags
      parameters:
      - description: The pagination cursor value.
        example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw
        explode: true
        in: query
        name: cursor
        required: false
        schema:
          type: string
        style: form
      - description: Number of results to return per page. 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/PaginatedTagsList'
          description: A list of tags created by your organization.
      security:
      - BearerAuth: []
      tags:
      - tags
  /tags/{tag_id}/users/{user_id}:
    post:
      description: Applies a tag to a user.
      operationId: add_user_tag
      parameters:
      - description: The ID of the tag to apply.
        name: tag_id
        example: 1b978423-db0a-4037-a4cf-f79c60cb67b3
        explode: false
        in: path
        required: true
        schema:
          format: uuid
          type: string
        style: simple
      - description: The ID of the user to apply the tag to.
        name: user_id
        example: 1b978423-db0a-4037-a4cf-f79c60cb67b3
        explode: false
        in: path
        required: true
        schema:
          format: uuid
          type: string
        style: simple
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: Tag applied to user successfully.
      security:
      - BearerAuth: []
      tags:
      - tags
    delete:
      description: Removes a tag from a user.
      operationId: remove_user_tag
      parameters:
      - description: The ID of the tag to remove.
        name: tag_id
        example: 1b978423-db0a-4037-a4cf-f79c60cb67b3
        explode: false
        in: path
        required: true
        schema:
          format: uuid
          type: string
        style: simple
      - description: The ID of the user to remove the tag from.
        example: 1b978423-db0a-4037-a4cf-f79c60cb67b3
        explode: false
        in: path
        name: user_id
        required: true
        schema:
          format: uuid
          type: string
        style: simple
      responses:
        '200':
          description: Tag removed from user successfully.
      security:
      - BearerAuth: []
      tags:
      - tags
  /tags/{tag_id}/groups/{group_id}:
    post:
      description: Applies a tag to a group.
      operationId: add_group_tag
      parameters:
      - description: The ID of the tag to apply.
        name: tag_id
        example: 1b978423-db0a-4037-a4cf-f79c60cb67b3
        explode: false
        in: path
        required: true
        schema:
          format: uuid
          type: string
        style: simple
      - description: The ID of the group to apply the tag to.
        name: group_id
        example: 1b978423-db0a-4037-a4cf-f79c60cb67b3
        explode: false
        in: path
        required: true
        schema:
          format: uuid
          type: string
        style: simple
      responses:
        '200':
          description: Tag applied to group successfully.
      security:
      - BearerAuth: []
      tags:
      - tags
    delete:
      description: Removes a tag from a group.
      operationId: remove_group_tag
      parameters:
      - description: The ID of the tag to remove.
        name: tag_id
        example: 1b978423-db0a-4037-a4cf-f79c60cb67b3
        explode: false
        in: path
        required: true
        schema:
          format: uuid
          type: string
        style: simple
      - description: The ID of the group to remove the tag from.
        example: 1b978423-db0a-4037-a4cf-f79c60cb67b3
        explode: false
        in: path
        name: group_id
        required: true
        schema:
          format: uuid
          type: string
        style: simple
      responses:
        '200':
          description: Tag removed from group successfully.
      security:
      - BearerAuth: []
      tags:
      - tags
  /tags/{tag_id}/resources/{resource_id}:
    post:
      description: Applies a tag to a resource.
      operationId: add_resource_tag
      parameters:
      - description: The ID of the tag to apply.
        name: tag_id
        example: 1b978423-db0a-4037-a4cf-f79c60cb67b3
        explode: false
        in: path
        required: true
        schema:
          format: uuid
          type: string
        style: simple
      - description: The ID of the resource to apply the tag to.
        name: resource_id
        example: 1b978423-db0a-4037-a4cf-f79c60cb67b3
        explode: false
        in: path
        required: true
        schema:
          format: uuid
          type: string
        style: simple
      responses:
        '200':
          description: Tag applied to resource successfully.
      security:
      - BearerAuth: []
      tags:
      - tags
    delete:
      description: Removes a tag from a resource.
      operationId: remove_resource_tag
      parameters:
      - description: The ID of the tag to remove.
        name: tag_id
        example: 1b978423-db0a-4037-a4cf-f79c60cb67b3
        explode: false
        in: path
        required: true
        schema:
          format: uuid
          type: string
        style: simple
      - description: The ID of the resource to remove the tag from.
        example: 1b978423-db0a-4037-a4cf-f79c60cb67b3
        explode: false
        in: path
        name: resource_id
        required: true
        schema:
          format: uuid
          type: string
        style: simple
      responses:
        '200':
          description: Tag removed from resource successfully.
      security:
      - BearerAuth: []
      tags:
      - tags
components:
  schemas:
    PaginatedTagsList:
      example:
        next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw
        previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ
        results:
        - tag_id: f290a738-5f9f-43c2-ad67-fa31ff0eb946
          created_at: 2022-01-23 04:56:07+00:00
          updated_at: 2022-02-23 01:34:07+00:00
          user_creator_id: d4a7d928-783e-4599-8ec6-088d635a5bcc
          admin_owner_id: bfb518b1-3f5b-4e3b-8eb8-3b3fabd4ea2b
          key: database-name
          value: redis_db
        - tag_id: 92f0a738-5f9f-43c2-ad67-fa31ff0eb052
          created_at: 2022-03-23 04:56:07+00:00
          updated_at: 2022-04-23 01:34:07+00:00
          user_creator_id: a4d7d928-783e-4599-8ec6-088d635af4ac
          admin_owner_id: gtg418b1-3f5b-4e3b-8eb8-3b3fabd4eaa1
          key: database-type
          value: sql
      properties:
        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
        results:
          items:
            $ref: '#/components/schemas/Tag'
          type: array
      required:
      - results
      type: object
    Tag:
      description: '# Tag Object

        ### Description

        The `Tag` object is used to represent a tag.


        ### Usage Example

        Get tags from the `GET Tag` endpoint.'
      example:
        tag_id: f290a738-5f9f-43c2-ad67-fa31ff0eb946
        created_at: 2022-01-23 04:56:07+00:00
        updated_at: 2022-02-23 01:34:07+00:00
        user_creator_id: d4a7d928-783e-4599-8ec6-088d635a5bcc
        key: database-name
        value: redis_db
      properties:
        tag_id:
          description: The ID of the tag.
          example: f290a738-5f9f-43c2-ad67-fa31ff0eb946
          format: uuid
          type: string
        created_at:
          description: The date the tag was created.
          example: 2022-01-23 04:56:07+00:00
          format: date-time
          type: string
        updated_at:
          description: The date the tag was last updated.
          example: 2022-02-23 01:34:07+00:00
          format: date-time
          type: string
        user_creator_id:
          description: The ID of the user that created the tag.
          example: d4a7d928-783e-4599-8ec6-088d635a5bcc
          format: uuid
          type: string
        key:
          description: The key of the tag.
          example: database-name
          type: string
        value:
          description: The value of the tag.
          example: redis_db
          type: string
      type: object
      required:
      - tag_id
    CreateTagInfo:
      description: '# CreateTagInfo Object

        ### Description

        The `CreateTagInfo` object is used to represent configuration for a new tag.


        ### Usage Example

        Use in the `POST Tag` endpoint.'
      example:
        tag_key: api-scope
        tag_value: production
      properties:
        tag_key:
          description: The key of the tag to create.
          example: api-scope
          type: string
        tag_value:
          description: The value of the tag to create.
          example: production
          type: string
      required:
      - tag_key
      type: object
  securitySchemes:
    BearerAuth:
      scheme: bearer
      type: http