Socket repo-labels API

The repo-labels API from Socket — 5 operation(s) for repo-labels.

Documentation

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

socket-dev-repo-labels-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  description: Socket alerts API endpoints.
  title: Socket alerts repo-labels API
  version: '0'
servers:
- url: https://api.socket.dev/v0
tags:
- name: repo-labels
paths:
  /orgs/{org_slug}/repos/labels/{label_id}/associate:
    post:
      tags:
      - repo-labels
      summary: Associate repository label (beta)
      operationId: associateOrgRepoLabel
      parameters:
      - name: org_slug
        in: path
        required: true
        description: The slug of the organization
        schema:
          type: string
      - name: label_id
        in: path
        required: true
        description: The ID of the label
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                repository_id:
                  type: string
                  description: The ID of the repository to associate with the label
                  default: ''
              description: ''
        required: false
      security:
      - bearerAuth:
        - repo-label:update
      - basicAuth:
        - repo-label:update
      description: 'Associate a repository label with a repository.


        Labels can be used to group and organize repositories and to apply security/license policies.


        This endpoint consumes 1 unit of your quota.


        This endpoint requires the following org token scopes:

        - repo-label:update'
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                properties:
                  status:
                    type: string
                    description: Status of the operation
                    default: ''
                description: ''
          description: Associates a repository label with the specified repository. The authenticated user must be a member of the organization.
        '400':
          $ref: '#/components/responses/SocketBadRequest'
        '401':
          $ref: '#/components/responses/SocketUnauthorized'
        '403':
          $ref: '#/components/responses/SocketForbidden'
        '404':
          $ref: '#/components/responses/SocketNotFoundResponse'
        '429':
          $ref: '#/components/responses/SocketTooManyRequestsResponse'
      x-readme: {}
  /orgs/{org_slug}/repos/labels:
    post:
      tags:
      - repo-labels
      summary: Create repository label (beta)
      operationId: createOrgRepoLabel
      parameters:
      - name: org_slug
        in: path
        required: true
        description: The slug of the organization
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              description: ''
              properties:
                name:
                  type: string
                  description: The name of the label
                  default: ''
              required:
              - name
        required: true
      security:
      - bearerAuth:
        - repo-label:create
      - basicAuth:
        - repo-label:create
      description: 'Create a repository label.


        Labels can be used to group and organize repositories and to apply security/license policies.


        This endpoint consumes 1 unit of your quota.


        This endpoint requires the following org token scopes:

        - repo-label:create'
      responses:
        '201':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                properties:
                  id:
                    type: string
                    description: The ID of the label
                    default: ''
                  name:
                    type: string
                    description: The name of the label
                    default: ''
                  repository_ids:
                    type: array
                    items:
                      type: string
                      description: Repository ID
                      default: ''
                    description: The IDs of repositories this label is associated with
                  has_security_policy:
                    type: boolean
                    default: false
                    description: Whether the label has a security policy
                  has_license_policy:
                    type: boolean
                    default: false
                    description: Whether the label has a license policy
                description: ''
          description: Creates a new repository label for the specified organization. The authenticated user must be a member of the organization. Label names must be non-empty and less than 1000 characters.
        '400':
          $ref: '#/components/responses/SocketBadRequest'
        '401':
          $ref: '#/components/responses/SocketUnauthorized'
        '403':
          $ref: '#/components/responses/SocketForbidden'
        '404':
          $ref: '#/components/responses/SocketNotFoundResponse'
        '409':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                description: ''
                properties:
                  error:
                    type: object
                    additionalProperties: false
                    description: ''
                    properties:
                      message:
                        type: string
                        description: ''
                        default: ''
                      details:
                        type: object
                        description: ''
                        default: null
                        nullable: true
                    required:
                    - details
                    - message
                required:
                - error
          description: Conflict
        '429':
          $ref: '#/components/responses/SocketTooManyRequestsResponse'
      x-readme: {}
    get:
      tags:
      - repo-labels
      summary: List repository labels (beta)
      operationId: getOrgRepoLabelList
      parameters:
      - name: org_slug
        in: path
        required: true
        description: The slug of the organization
        schema:
          type: string
      - name: per_page
        in: query
        required: false
        description: ''
        schema:
          type: integer
          minimum: 1
          maximum: 100
          default: 30
      - name: page
        in: query
        required: false
        description: ''
        schema:
          type: integer
          minimum: 1
          default: 1
      security:
      - bearerAuth:
        - repo-label:list
      - basicAuth:
        - repo-label:list
      description: 'Lists repository labels for the specified organization.


        This endpoint consumes 1 unit of your quota.


        This endpoint requires the following org token scopes:

        - repo-label:list'
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                description: ''
                properties:
                  results:
                    type: array
                    items:
                      type: object
                      additionalProperties: false
                      properties:
                        id:
                          type: string
                          description: The ID of the label
                          default: ''
                        name:
                          type: string
                          description: The name of the label
                          default: ''
                        repository_ids:
                          type: array
                          items:
                            type: string
                            description: Repository ID
                            default: ''
                          description: The IDs of repositories this label is associated with
                        has_security_policy:
                          type: boolean
                          default: false
                          description: Whether the label has a security policy
                        has_license_policy:
                          type: boolean
                          default: false
                          description: Whether the label has a license policy
                      description: ''
                    description: ''
                  nextPage:
                    type: integer
                    description: ''
                    default: 0
                    nullable: true
                required:
                - nextPage
                - results
          description: Lists repository labels for the specified organization. The authenticated user must be a member of the organization.
        '400':
          $ref: '#/components/responses/SocketBadRequest'
        '401':
          $ref: '#/components/responses/SocketUnauthorized'
        '403':
          $ref: '#/components/responses/SocketForbidden'
        '404':
          $ref: '#/components/responses/SocketNotFoundResponse'
        '429':
          $ref: '#/components/responses/SocketTooManyRequestsResponse'
      x-readme: {}
  /orgs/{org_slug}/repos/labels/{label_id}:
    delete:
      tags:
      - repo-labels
      summary: Delete repository label (beta)
      operationId: deleteOrgRepoLabel
      parameters:
      - name: org_slug
        in: path
        required: true
        description: The slug of the organization
        schema:
          type: string
      - name: label_id
        in: path
        required: true
        description: The ID of the label
        schema:
          type: string
      security:
      - bearerAuth:
        - repo-label:delete
      - basicAuth:
        - repo-label:delete
      description: 'Delete a repository label and all of its associations (repositories, security policy, license policy, etc.).


        This endpoint consumes 1 unit of your quota.


        This endpoint requires the following org token scopes:

        - repo-label:delete'
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                description: ''
                properties:
                  status:
                    type: string
                    description: ''
                    default: ok
                required:
                - status
          description: Success
        '400':
          $ref: '#/components/responses/SocketBadRequest'
        '401':
          $ref: '#/components/responses/SocketUnauthorized'
        '403':
          $ref: '#/components/responses/SocketForbidden'
        '404':
          $ref: '#/components/responses/SocketNotFoundResponse'
        '429':
          $ref: '#/components/responses/SocketTooManyRequestsResponse'
      x-readme: {}
    get:
      tags:
      - repo-labels
      summary: Get repository label (beta)
      operationId: getOrgRepoLabel
      parameters:
      - name: org_slug
        in: path
        required: true
        description: The slug of the organization
        schema:
          type: string
      - name: label_id
        in: path
        required: true
        description: The ID of the label
        schema:
          type: string
      security:
      - bearerAuth:
        - repo-label:list
      - basicAuth:
        - repo-label:list
      description: 'Retrieve a repository label associated with an organization and label ID.


        This endpoint consumes 1 unit of your quota.


        This endpoint requires the following org token scopes:

        - repo-label:list'
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                properties:
                  id:
                    type: string
                    description: The ID of the label
                    default: ''
                  name:
                    type: string
                    description: The name of the label
                    default: ''
                  repository_ids:
                    type: array
                    items:
                      type: string
                      description: Repository ID
                      default: ''
                    description: The IDs of repositories this label is associated with
                  has_security_policy:
                    type: boolean
                    default: false
                    description: Whether the label has a security policy
                  has_license_policy:
                    type: boolean
                    default: false
                    description: Whether the label has a license policy
                description: ''
          description: Returns a specific repository label for the specified organization. The authenticated user must be a member of the organization.
        '400':
          $ref: '#/components/responses/SocketBadRequest'
        '401':
          $ref: '#/components/responses/SocketUnauthorized'
        '403':
          $ref: '#/components/responses/SocketForbidden'
        '404':
          $ref: '#/components/responses/SocketNotFoundResponse'
        '429':
          $ref: '#/components/responses/SocketTooManyRequestsResponse'
      x-readme: {}
    put:
      tags:
      - repo-labels
      summary: Update repository label (beta)
      operationId: updateOrgRepoLabel
      parameters:
      - name: org_slug
        in: path
        required: true
        description: The slug of the organization
        schema:
          type: string
      - name: label_id
        in: path
        required: true
        description: The ID of the label
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              description: ''
              properties:
                name:
                  type: string
                  description: The name of the label
                  default: ''
              required:
              - name
        required: true
      security:
      - bearerAuth:
        - repo-label:update
      - basicAuth:
        - repo-label:update
      description: 'Update a repository label name.


        Labels can be used to group and organize repositories and to apply security/license policies.


        This endpoint consumes 1 unit of your quota.


        This endpoint requires the following org token scopes:

        - repo-label:update'
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                properties:
                  id:
                    type: string
                    description: The ID of the label
                    default: ''
                  name:
                    type: string
                    description: The name of the label
                    default: ''
                  repository_ids:
                    type: array
                    items:
                      type: string
                      description: Repository ID
                      default: ''
                    description: The IDs of repositories this label is associated with
                  has_security_policy:
                    type: boolean
                    default: false
                    description: Whether the label has a security policy
                  has_license_policy:
                    type: boolean
                    default: false
                    description: Whether the label has a license policy
                description: ''
          description: Updates an existing repository label for the specified organization. The authenticated user must be a member of the organization. Label names must be non-empty and less than 1000 characters.
        '400':
          $ref: '#/components/responses/SocketBadRequest'
        '401':
          $ref: '#/components/responses/SocketUnauthorized'
        '403':
          $ref: '#/components/responses/SocketForbidden'
        '404':
          $ref: '#/components/responses/SocketNotFoundResponse'
        '409':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                description: ''
                properties:
                  error:
                    type: object
                    additionalProperties: false
                    description: ''
                    properties:
                      message:
                        type: string
                        description: ''
                        default: ''
                      details:
                        type: object
                        description: ''
                        default: null
                        nullable: true
                    required:
                    - details
                    - message
                required:
                - error
          description: Conflict
        '429':
          $ref: '#/components/responses/SocketTooManyRequestsResponse'
      x-readme: {}
  /orgs/{org_slug}/repos/labels/{label_id}/label-setting:
    delete:
      tags:
      - repo-labels
      summary: Delete repository label setting (beta)
      operationId: deleteOrgRepoLabelSetting
      parameters:
      - name: org_slug
        in: path
        required: true
        description: The slug of the organization
        schema:
          type: string
      - name: label_id
        in: path
        required: true
        description: The ID of the label
        schema:
          type: string
      - name: setting_key
        in: query
        required: true
        description: Setting key to delete from the repository label. Valid values include issueRules, issueRulesPolicyDefault, and licensePolicy
        schema:
          type: string
      security:
      - bearerAuth:
        - repo-label:update
      - basicAuth:
        - repo-label:update
      description: 'Delete the setting (e.g. security/license policy) for a repository label.



        Note that repository label settings currently only support `issueRules`

        and `issueRulesPolicyDefault`. A policy is considered "active" for

        a given repository label if the `issueRulesPolicyDefault` is set,

        and inactive when not set. `issueRules` can be used to further

        refine the alert triage strategy.


        This endpoint consumes 1 unit of your quota.


        This endpoint requires the following org token scopes:

        - repo-label:update'
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                description: ''
                properties:
                  status:
                    type: string
                    description: ''
                    default: ok
                required:
                - status
          description: Success
        '400':
          $ref: '#/components/responses/SocketBadRequest'
        '401':
          $ref: '#/components/responses/SocketUnauthorized'
        '403':
          $ref: '#/components/responses/SocketForbidden'
        '404':
          $ref: '#/components/responses/SocketNotFoundResponse'
        '429':
          $ref: '#/components/responses/SocketTooManyRequestsResponse'
      x-readme: {}
    get:
      tags:
      - repo-labels
      summary: Get repository label setting (beta)
      operationId: getOrgRepoLabelSetting
      parameters:
      - name: org_slug
        in: path
        required: true
        description: The slug of the organization
        schema:
          type: string
      - name: label_id
        in: path
        required: true
        description: The ID of the label
        schema:
          type: string
      - name: setting_key
        in: query
        required: true
        description: Setting key to query for in the repository label. Valid values include issueRules, issueRulesPolicyDefault, and licensePolicy
        schema:
          type: string
      security:
      - bearerAuth:
        - repo-label:list
      - basicAuth:
        - repo-label:list
      description: 'Retrieve the setting (e.g. security/license policy) for a repository label.



        Note that repository label settings currently only support `issueRules`

        and `issueRulesPolicyDefault`. A policy is considered "active" for

        a given repository label if the `issueRulesPolicyDefault` is set,

        and inactive when not set. `issueRules` can be used to further

        refine the alert triage strategy.


        This endpoint consumes 1 unit of your quota.


        This endpoint requires the following org token scopes:

        - repo-label:list'
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                properties:
                  issueRules:
                    type: object
                    additionalProperties: false
                    properties:
                      gptSecurity:
                        type: object
                        additionalProperties: false
                        description: ''
                        properties:
                          action:
                            type: string
                            enum:
                            - defer
                            - error
                            - warn
                            - monitor
                            - ignore
                            description: The action to take for gptSecurity issues.
                        required:
                        - action
                      gptAnomaly:
                        type: object
                        additionalProperties: false
                        description: ''
                        properties:
                          action:
                            type: string
                            enum:
                            - defer
                            - error
                            - warn
                            - monitor
                            - ignore
                            description: The action to take for gptAnomaly issues.
                        required:
                        - action
                      gptMalware:
                        type: object
                        additionalProperties: false
                        description: ''
                        properties:
                          action:
                            type: string
                            enum:
                            - defer
                            - error
                            - warn
                            - monitor
                            - ignore
                            description: The action to take for gptMalware issues.
                        required:
                        - action
                      filesystemAccess:
                        type: object
                        additionalProperties: false
                        description: ''
                        properties:
                          action:
                            type: string
                            enum:
                            - defer
                            - error
                            - warn
                            - monitor
                            - ignore
                            description: The action to take for filesystemAccess issues.
                        required:
                        - action
                      networkAccess:
                        type: object
                        additionalProperties: false
                        description: ''
                        properties:
                          action:
                            type: string
                            enum:
                            - defer
                            - error
                            - warn
                            - monitor
                            - ignore
                            description: The action to take for networkAccess issues.
                        required:
                        - action
                      shellAccess:
                        type: object
                        additionalProperties: false
                        description: ''
                        properties:
                          action:
                            type: string
                            enum:
                            - defer
                            - error
                            - warn
                            - monitor
                            - ignore
                            description: The action to take for shellAccess issues.
                        required:
                        - action
                      debugAccess:
                        type: object
                        additionalProperties: false
                        description: ''
                        properties:
                          action:
                            type: string
                            enum:
                            - defer
                            - error
                            - warn
                            - monitor
                            - ignore
                            description: The action to take for debugAccess issues.
                        required:
                        - action
                      chromePermission:
                        type: object
                        additionalProperties: false
                        description: ''
                        properties:
                          action:
                            type: string
                            enum:
                            - defer
                            - error
                            - warn
                            - monitor
                            - ignore
                            description: The action to take for chromePermission issues.
                        required:
                        - action
                      chromeHostPermission:
                        type: object
                        additionalProperties: false
                        description: ''
                        properties:
                          action:
                            type: string
                            enum:
                            - defer
                            - error
                            - warn
                            - monitor
                            - ignore
                            description: The action to take for chromeHostPermission issues.
                        required:
                        - action
                      chromeWildcardHostPermission:
                        type: object
                        additionalProperties: false
                        description: ''
                        properties:
                          action:
                            type: string
                            enum:
                            - defer
                            - error
                            - warn
                            - monitor
                            - ignore
                            description: The action to take for chromeWildcardHostPermission issues.
                        required:
                        - action
                      chromeContentScript:
                        type: object
                        additionalProperties: false
                        description: ''
                        properties:
                          action:
                            type: string
                            enum:
                            - defer
                            - error
                            - warn
                            - monitor
                            - ignore
                            description: The action to take for chromeContentScript issues.
                        required:
                        - action
                      criticalCVE:
                        type: object
                        additionalProperties: false
                        description: ''
                        properties:
                          action:
                            type: string
                            enum:
                            - defer
                            - error
                            - warn
                            - monitor
                            - ignore
                            description: The action to take for criticalCVE issues.
                        required:
                        - action
                      cve:
                        type: object
                        additionalProperties: false
                        description: ''
                        properties:
                          action:
                            type: string
                            enum:
                            - defer
                            - error
                            - warn
                            - monitor
                            - ignore
                            description: The action to take for cve issues.
                        required:
                        - action
                      mediumCVE:
                        type: object
                        additionalProperties: false
                        description: ''
                        properties:
                          action:
                            type: string
                            enum:
                            - defer
                            - error
                            - warn
                            - monitor
                            - ignore
                            description: The action to take for mediumCVE issues.
                        required:
                        - action
                      mildCVE:
                        type: object
                        additionalProperties: false
                        description: ''
                        properties:
                          action:
                            type: string
                            enum:
                            - defer
                            - error
                            - warn
                            - monitor
                            - ignore
                            description: The action to take for mildCVE issues.
                        required:
                        - action
                      emptyPackage:
                        type: object
                        additionalProperties: false
                        description: ''
                        properties:
                          action:
                            type: string
                            enum:
                            - defer
                            - error
                            - warn
                            - monitor
                            - ignore
                            description: The action to take for emptyPackage issues.
                        required:
                        - action
                      trivialPackage:
                        type: object
                        additionalProperties: false
                        description: ''
                        properties:
                          action:
                            type: string
                            enum:
                            - defer
                            - error
                            - warn
                            - monitor
                            - ignore
 

# --- truncated at 32 KB (200 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/socket-dev/refs/heads/main/openapi/socket-dev-repo-labels-api-openapi.yml