Google Drive Labels API

Labels are metadata that you define to help users organize, find, and apply policy to files in Google Drive. The Drive Labels API is a RESTful API that supports business processes by attaching metadata to your Drive files.

OpenAPI Specification

google-drive-labels-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Google Drive Labels API
  description: An API for managing Drive Labels
  version: v2
  contact:
    name: Google
    url: https://google.com
    x-twitter: youtube
  license:
    name: Creative Commons Attribution 3.0
    url: http://creativecommons.org/licenses/by/3.0/
  termsOfService: https://developers.google.com/terms/
servers:
  - url: https://drivelabels.googleapis.com
    description: Google Drive Labels API Server
tags:
  - name: Labels
    description: Operations related to Labels
  - name: Limits
    description: Operations related to Limits
  - name: Users
    description: Operations related to Users
externalDocs:
  url: https://developers.google.com/drive/labels
paths:
  /v2/labels:
    get:
      tags:
        - Labels
      summary: Google Retrieve Labels
      description: List labels.
      operationId: googleDrivelabelsLabelsList
      security:
        - Oauth2:
            - https://www.googleapis.com/auth/drive.admin.labels
          Oauth2c:
            - https://www.googleapis.com/auth/drive.admin.labels
        - Oauth2:
            - https://www.googleapis.com/auth/drive.admin.labels.readonly
          Oauth2c:
            - https://www.googleapis.com/auth/drive.admin.labels.readonly
        - Oauth2:
            - https://www.googleapis.com/auth/drive.labels
          Oauth2c:
            - https://www.googleapis.com/auth/drive.labels
        - Oauth2:
            - https://www.googleapis.com/auth/drive.labels.readonly
          Oauth2c:
            - https://www.googleapis.com/auth/drive.labels.readonly
      parameters:
        - description: 'The customer to scope this list request to. For example: "customers/abcd1234". If unset, will return all labels within the current customer.'
          in: query
          name: customer
          schema:
            type: string
        - description: The BCP-47 language code to use for evaluating localized field labels. When not specified, values in the default configured language are used.
          in: query
          name: languageCode
          schema:
            type: string
        - description: Specifies the level of access the user must have on the returned Labels. The minimum role a user must have on a label. Defaults to `READER`.
          in: query
          name: minimumRole
          schema:
            enum:
              - LABEL_ROLE_UNSPECIFIED
              - READER
              - APPLIER
              - ORGANIZER
              - EDITOR
            type: string
        - description: 'Maximum number of labels to return per page. Default: 50. Max: 200.'
          in: query
          name: pageSize
          schema:
            type: integer
        - description: The token of the page to return.
          in: query
          name: pageToken
          schema:
            type: string
        - description: Whether to include only published labels in the results. * When `true`, only the current published label revisions are returned. Disabled labels are included. Returned label resource names reference the published revision (`labels/{id}/{revision_id}`). * When `false`, the current label revisions are returned, which might not be published. Returned label resource names don't reference a specific revision (`labels/{id}`).
          in: query
          name: publishedOnly
          schema:
            type: boolean
        - description: Set to `true` in order to use the user's admin credentials. This will return all Labels within the customer.
          in: query
          name: useAdminAccess
          schema:
            type: boolean
        - description: When specified, only certain fields belonging to the indicated view are returned.
          in: query
          name: view
          schema:
            enum:
              - LABEL_VIEW_BASIC
              - LABEL_VIEW_FULL
            type: string
        - description: V1 error format.
          in: query
          name: $.xgafv
          schema:
            enum:
              - '1'
              - '2'
            type: string
        - description: OAuth access token.
          in: query
          name: access_token
          schema:
            type: string
        - description: Data format for response.
          in: query
          name: alt
          schema:
            enum:
              - json
              - media
              - proto
            type: string
        - description: JSONP
          in: query
          name: callback
          schema:
            type: string
        - description: Selector specifying which fields to include in a partial response.
          in: query
          name: fields
          schema:
            type: string
        - description: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
          in: query
          name: key
          schema:
            type: string
        - description: OAuth 2.0 token for the current user.
          in: query
          name: oauth_token
          schema:
            type: string
        - description: Returns response with indentations and line breaks.
          in: query
          name: prettyPrint
          schema:
            type: boolean
        - description: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
          in: query
          name: quotaUser
          schema:
            type: string
        - description: Upload protocol for media (e.g. "raw", "multipart").
          in: query
          name: upload_protocol
          schema:
            type: string
        - description: Legacy upload protocol for media (e.g. "media", "multipart").
          in: query
          name: uploadType
          schema:
            type: string
        - in: header
          name: Authorization
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleAppsDriveLabelsV2ListLabelsResponse'
      x-microcks-operation:
        delay: 100
        dispatcher: FALLBACK
        dispatcherRules: SuccessExample
    post:
      tags:
        - Labels
      summary: Google Create Labels
      description: Creates a new Label.
      operationId: googleDrivelabelsLabelsCreate
      security:
        - Oauth2:
            - https://www.googleapis.com/auth/drive.admin.labels
          Oauth2c:
            - https://www.googleapis.com/auth/drive.admin.labels
        - Oauth2:
            - https://www.googleapis.com/auth/drive.labels
          Oauth2c:
            - https://www.googleapis.com/auth/drive.labels
      parameters:
        - description: The BCP-47 language code to use for evaluating localized Field labels in response. When not specified, values in the default configured language will be used.
          in: query
          name: languageCode
          schema:
            type: string
        - description: Set to `true` in order to use the user's admin privileges. The server will verify the user is an admin before allowing access.
          in: query
          name: useAdminAccess
          schema:
            type: boolean
        - description: V1 error format.
          in: query
          name: $.xgafv
          schema:
            enum:
              - '1'
              - '2'
            type: string
        - description: OAuth access token.
          in: query
          name: access_token
          schema:
            type: string
        - description: Data format for response.
          in: query
          name: alt
          schema:
            enum:
              - json
              - media
              - proto
            type: string
        - description: JSONP
          in: query
          name: callback
          schema:
            type: string
        - description: Selector specifying which fields to include in a partial response.
          in: query
          name: fields
          schema:
            type: string
        - description: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
          in: query
          name: key
          schema:
            type: string
        - description: OAuth 2.0 token for the current user.
          in: query
          name: oauth_token
          schema:
            type: string
        - description: Returns response with indentations and line breaks.
          in: query
          name: prettyPrint
          schema:
            type: boolean
        - description: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
          in: query
          name: quotaUser
          schema:
            type: string
        - description: Upload protocol for media (e.g. "raw", "multipart").
          in: query
          name: upload_protocol
          schema:
            type: string
        - description: Legacy upload protocol for media (e.g. "media", "multipart").
          in: query
          name: uploadType
          schema:
            type: string
        - in: header
          name: Authorization
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GoogleAppsDriveLabelsV2Label'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleAppsDriveLabelsV2Label'
      x-microcks-operation:
        delay: 100
        dispatcher: FALLBACK
        dispatcherRules: SuccessExample
  /v2/limits/label:
    get:
      tags:
        - Limits
      summary: Google Retrieve Limits Label
      description: Get the constraints on the structure of a Label; such as, the maximum number of Fields allowed and maximum length of the label title.
      operationId: googleDrivelabelsLimitsGetlabel
      security:
        - Oauth2:
            - https://www.googleapis.com/auth/drive.admin.labels
          Oauth2c:
            - https://www.googleapis.com/auth/drive.admin.labels
        - Oauth2:
            - https://www.googleapis.com/auth/drive.admin.labels.readonly
          Oauth2c:
            - https://www.googleapis.com/auth/drive.admin.labels.readonly
        - Oauth2:
            - https://www.googleapis.com/auth/drive.labels
          Oauth2c:
            - https://www.googleapis.com/auth/drive.labels
        - Oauth2:
            - https://www.googleapis.com/auth/drive.labels.readonly
          Oauth2c:
            - https://www.googleapis.com/auth/drive.labels.readonly
      parameters:
        - description: 'Required. Label revision resource name Must be: "limits/label"'
          in: query
          name: name
          schema:
            type: string
        - description: V1 error format.
          in: query
          name: $.xgafv
          schema:
            enum:
              - '1'
              - '2'
            type: string
        - description: OAuth access token.
          in: query
          name: access_token
          schema:
            type: string
        - description: Data format for response.
          in: query
          name: alt
          schema:
            enum:
              - json
              - media
              - proto
            type: string
        - description: JSONP
          in: query
          name: callback
          schema:
            type: string
        - description: Selector specifying which fields to include in a partial response.
          in: query
          name: fields
          schema:
            type: string
        - description: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
          in: query
          name: key
          schema:
            type: string
        - description: OAuth 2.0 token for the current user.
          in: query
          name: oauth_token
          schema:
            type: string
        - description: Returns response with indentations and line breaks.
          in: query
          name: prettyPrint
          schema:
            type: boolean
        - description: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
          in: query
          name: quotaUser
          schema:
            type: string
        - description: Upload protocol for media (e.g. "raw", "multipart").
          in: query
          name: upload_protocol
          schema:
            type: string
        - description: Legacy upload protocol for media (e.g. "media", "multipart").
          in: query
          name: uploadType
          schema:
            type: string
        - in: header
          name: Authorization
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleAppsDriveLabelsV2LabelLimits'
      x-microcks-operation:
        delay: 100
        dispatcher: FALLBACK
        dispatcherRules: SuccessExample
  /v2/{name}:
    get:
      tags:
        - Users
      summary: Google Retrieve Name
      description: Gets the user capabilities.
      operationId: googleDrivelabelsUsersGetcapabilities
      security:
        - Oauth2:
            - https://www.googleapis.com/auth/drive.admin.labels
          Oauth2c:
            - https://www.googleapis.com/auth/drive.admin.labels
        - Oauth2:
            - https://www.googleapis.com/auth/drive.admin.labels.readonly
          Oauth2c:
            - https://www.googleapis.com/auth/drive.admin.labels.readonly
        - Oauth2:
            - https://www.googleapis.com/auth/drive.labels
          Oauth2c:
            - https://www.googleapis.com/auth/drive.labels
        - Oauth2:
            - https://www.googleapis.com/auth/drive.labels.readonly
          Oauth2c:
            - https://www.googleapis.com/auth/drive.labels.readonly
      parameters:
        - description: Required. The resource name of the user. Only "users/me/capabilities" is supported.
          in: path
          name: name
          required: true
          schema:
            type: string
        - description: 'The customer to scope this request to. For example: "customers/abcd1234". If unset, will return settings within the current customer.'
          in: query
          name: customer
          schema:
            type: string
        - description: Set to `true` in order to use the user's admin credentials. The server verifies that the user is an admin for the label before allowing access.
          in: query
          name: useAdminAccess
          schema:
            type: boolean
        - description: When specified, only certain fields belonging to the indicated view are returned.
          in: query
          name: view
          schema:
            enum:
              - LABEL_VIEW_BASIC
              - LABEL_VIEW_FULL
            type: string
        - description: V1 error format.
          in: query
          name: $.xgafv
          schema:
            enum:
              - '1'
              - '2'
            type: string
        - description: OAuth access token.
          in: query
          name: access_token
          schema:
            type: string
        - description: Data format for response.
          in: query
          name: alt
          schema:
            enum:
              - json
              - media
              - proto
            type: string
        - description: JSONP
          in: query
          name: callback
          schema:
            type: string
        - description: Selector specifying which fields to include in a partial response.
          in: query
          name: fields
          schema:
            type: string
        - description: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
          in: query
          name: key
          schema:
            type: string
        - description: OAuth 2.0 token for the current user.
          in: query
          name: oauth_token
          schema:
            type: string
        - description: Returns response with indentations and line breaks.
          in: query
          name: prettyPrint
          schema:
            type: boolean
        - description: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
          in: query
          name: quotaUser
          schema:
            type: string
        - description: Upload protocol for media (e.g. "raw", "multipart").
          in: query
          name: upload_protocol
          schema:
            type: string
        - description: Legacy upload protocol for media (e.g. "media", "multipart").
          in: query
          name: uploadType
          schema:
            type: string
        - in: header
          name: Authorization
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleAppsDriveLabelsV2UserCapabilities'
      x-microcks-operation:
        delay: 100
        dispatcher: FALLBACK
        dispatcherRules: SuccessExample
    delete:
      tags:
        - Labels
      summary: Google Delete  Name
      description: Deletes a Label's permission. Permissions affect the Label resource as a whole, are not revisioned, and do not require publishing.
      operationId: googleDrivelabelsLabelsRevisionsPermissionsDelete
      security:
        - Oauth2:
            - https://www.googleapis.com/auth/drive.admin.labels
          Oauth2c:
            - https://www.googleapis.com/auth/drive.admin.labels
        - Oauth2:
            - https://www.googleapis.com/auth/drive.labels
          Oauth2c:
            - https://www.googleapis.com/auth/drive.labels
      parameters:
        - description: Required. Label Permission resource name.
          in: path
          name: name
          required: true
          schema:
            type: string
        - description: Set to `true` in order to use the user's admin credentials. The server will verify the user is an admin for the Label before allowing access.
          in: query
          name: useAdminAccess
          schema:
            type: boolean
        - description: The revision_id of the label that the write request will be applied to. If this is not the latest revision of the label, the request will not be processed and will return a 400 Bad Request error.
          in: query
          name: writeControl.requiredRevisionId
          schema:
            type: string
        - description: V1 error format.
          in: query
          name: $.xgafv
          schema:
            enum:
              - '1'
              - '2'
            type: string
        - description: OAuth access token.
          in: query
          name: access_token
          schema:
            type: string
        - description: Data format for response.
          in: query
          name: alt
          schema:
            enum:
              - json
              - media
              - proto
            type: string
        - description: JSONP
          in: query
          name: callback
          schema:
            type: string
        - description: Selector specifying which fields to include in a partial response.
          in: query
          name: fields
          schema:
            type: string
        - description: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
          in: query
          name: key
          schema:
            type: string
        - description: OAuth 2.0 token for the current user.
          in: query
          name: oauth_token
          schema:
            type: string
        - description: Returns response with indentations and line breaks.
          in: query
          name: prettyPrint
          schema:
            type: boolean
        - description: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
          in: query
          name: quotaUser
          schema:
            type: string
        - description: Upload protocol for media (e.g. "raw", "multipart").
          in: query
          name: upload_protocol
          schema:
            type: string
        - description: Legacy upload protocol for media (e.g. "media", "multipart").
          in: query
          name: uploadType
          schema:
            type: string
        - in: header
          name: Authorization
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleProtobufEmpty'
      x-microcks-operation:
        delay: 100
        dispatcher: FALLBACK
        dispatcherRules: SuccessExample
  /v2/{name}:delta:
    post:
      tags:
        - Labels
      summary: Google Create Name:delta
      description: 'Updates a single Label by applying a set of update requests resulting in a new draft revision. The batch update is all-or-nothing: If any of the update requests are invalid, no changes are applied. The resulting draft revision must be published before the changes may be used with Drive Items.'
      operationId: googleDrivelabelsLabelsDelta
      security:
        - Oauth2:
            - https://www.googleapis.com/auth/drive.admin.labels
          Oauth2c:
            - https://www.googleapis.com/auth/drive.admin.labels
        - Oauth2:
            - https://www.googleapis.com/auth/drive.labels
          Oauth2c:
            - https://www.googleapis.com/auth/drive.labels
      parameters:
        - description: Required. The resource name of the Label to update.
          in: path
          name: name
          required: true
          schema:
            type: string
        - description: V1 error format.
          in: query
          name: $.xgafv
          schema:
            enum:
              - '1'
              - '2'
            type: string
        - description: OAuth access token.
          in: query
          name: access_token
          schema:
            type: string
        - description: Data format for response.
          in: query
          name: alt
          schema:
            enum:
              - json
              - media
              - proto
            type: string
        - description: JSONP
          in: query
          name: callback
          schema:
            type: string
        - description: Selector specifying which fields to include in a partial response.
          in: query
          name: fields
          schema:
            type: string
        - description: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
          in: query
          name: key
          schema:
            type: string
        - description: OAuth 2.0 token for the current user.
          in: query
          name: oauth_token
          schema:
            type: string
        - description: Returns response with indentations and line breaks.
          in: query
          name: prettyPrint
          schema:
            type: boolean
        - description: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
          in: query
          name: quotaUser
          schema:
            type: string
        - description: Upload protocol for media (e.g. "raw", "multipart").
          in: query
          name: upload_protocol
          schema:
            type: string
        - description: Legacy upload protocol for media (e.g. "media", "multipart").
          in: query
          name: uploadType
          schema:
            type: string
        - in: header
          name: Authorization
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GoogleAppsDriveLabelsV2DeltaUpdateLabelRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleAppsDriveLabelsV2DeltaUpdateLabelResponse'
      x-microcks-operation:
        delay: 100
        dispatcher: FALLBACK
        dispatcherRules: SuccessExample
  /v2/{name}:disable:
    post:
      tags:
        - Labels
      summary: Google Create Name:disable
      description: Disable a published Label. Disabling a Label will result in a new disabled published revision based on the current published revision. If there is a draft revision, a new disabled draft revision will be created based on the latest draft revision. Older draft revisions will be deleted. Once disabled, a label may be deleted with `DeleteLabel`.
      operationId: googleDrivelabelsLabelsDisable
      security:
        - Oauth2:
            - https://www.googleapis.com/auth/drive.admin.labels
          Oauth2c:
            - https://www.googleapis.com/auth/drive.admin.labels
        - Oauth2:
            - https://www.googleapis.com/auth/drive.labels
          Oauth2c:
            - https://www.googleapis.com/auth/drive.labels
      parameters:
        - description: Required. Label resource name.
          in: path
          name: name
          required: true
          schema:
            type: string
        - description: V1 error format.
          in: query
          name: $.xgafv
          schema:
            enum:
              - '1'
              - '2'
            type: string
        - description: OAuth access token.
          in: query
          name: access_token
          schema:
            type: string
        - description: Data format for response.
          in: query
          name: alt
          schema:
            enum:
              - json
              - media
              - proto
            type: string
        - description: JSONP
          in: query
          name: callback
          schema:
            type: string
        - description: Selector specifying which fields to include in a partial response.
          in: query
          name: fields
          schema:
            type: string
        - description: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
          in: query
          name: key
          schema:
            type: string
        - description: OAuth 2.0 token for the current user.
          in: query
          name: oauth_token
          schema:
            type: string
        - description: Returns response with indentations and line breaks.
          in: query
          name: prettyPrint
          schema:
            type: boolean
        - description: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
          in: query
          name: quotaUser
          schema:
            type: string
        - description: Upload protocol for media (e.g. "raw", "multipart").
          in: query
          name: upload_protocol
          schema:
            type: string
        - description: Legacy upload protocol for media (e.g. "media", "multipart").
          in: query
          name: uploadType
          schema:
            type: string
        - in: header
          name: Authorization
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GoogleAppsDriveLabelsV2DisableLabelRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleAppsDriveLabelsV2Label'
      x-microcks-operation:
        delay: 100
        dispatcher: FALLBACK
        dispatcherRules: SuccessExample
  /v2/{name}:enable:
    post:
      tags:
        - Labels
      summary: Google Create Name:enable
      description: Enable a disabled Label and restore it to its published state. This will result in a new published revision based on the current disabled published revision. If there is an existing disabled draft revision, a new revision will be created based on that draft and will be enabled.
      operationId: googleDrivelabelsLabelsEnable
      security:
        - Oauth2:
            - https://www.googleapis.com/auth/drive.admin.labels
          Oauth2c:
            - https://www.googleapis.com/auth/drive.admin.labels
        - Oauth2:
            - https://www.googleapis.com/auth/drive.labels
          Oauth2c:
            - https://www.googleapis.com/auth/drive.labels
      parameters:
        - description: Required. Label resource name.
          in: path
          name: name
          required: true
          schema:
            type: string
        - description: V1 error format.
          in: query
          name: $.xgafv
          schema:
            enum:
              - '1'
              - '2'
            type: string
        - description: OAuth access token.
          in: query
          name: access_token
          schema:
            type: string
        - description: Data format for response.
          in: query
          name: alt
          schema:
            enum:
              - json
              - media
              - proto
            type: string
        - description: JSONP
          in: query
          name: callback
          schema:
            type: string
        - description: Selector specifying which fields to include in a partial response.
          in: query
          name: fields
          schema:
            type: string
        - description: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
          in: query
          name: key
          schema:
            type: string
        - description: OAuth 2.0 token for the current user.
          in: query
          name: oauth_token
          schema:
            type: string
        - description: Returns response with indentations and line breaks.
          in: query
          name: prettyPrint
          schema:
            type: boolean
        - description: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
          in: query
          name: quotaUser
          schema:
            type: string
        - description: Upload protocol for media (e.g. "raw", "multipart").
          in: query
          name: upload_protocol
          schema:
            type: string
        - description: Legacy upload protocol for media (e.g. "media", "multipart").
          in: query
          name: uploadType
          schema:
            type: string
        - in: header
          name: Authorization
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GoogleAppsDriveLabelsV2EnableLabelRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleAppsDriveLabelsV2Label'
      x-microcks-operation:
        delay: 100
        dispatcher: FALLBACK
        dispatcherRules: SuccessExample
  /v2/{name}:publish:
    post:
      tags:
        - Labels
      summary: Google Create Name:publi

# --- truncated at 32 KB (135 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/google/refs/heads/main/openapi/google-drive-labels-api-openapi.yml