> ## Documentation Index
> Fetch the complete documentation index at: https://infisical.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Update

> Update the specified GitLab Service Account Token Rotation.



## OpenAPI

````yaml PATCH /api/v2/secret-rotations/gitlab-service-account-token/{rotationId}
openapi: 3.0.3
info:
  title: Infisical API
  description: List of all available APIs that can be consumed
  version: 0.0.1
servers:
  - url: https://us.infisical.com
    description: Production server (US)
  - url: https://eu.infisical.com
    description: Production server (EU)
  - url: http://localhost:8080
    description: Local server
security: []
paths:
  /api/v2/secret-rotations/gitlab-service-account-token/{rotationId}:
    patch:
      tags:
        - Secret Rotations
      description: Update the specified GitLab Service Account Token Rotation.
      operationId: updateGitLabServiceAccountTokenRotation
      parameters:
        - schema:
            type: string
            format: uuid
          in: path
          name: rotationId
          required: true
          description: The ID of the GitLab Service Account Token Rotation to be updated.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 64
                  description: >-
                    The updated name of the GitLab Service Account Token
                    Rotation. Must be slug-friendly.
                description:
                  type: string
                  maxLength: 256
                  nullable: true
                  description: >-
                    The updated description of the GitLab Service Account Token
                    Rotation.
                isAutoRotationEnabled:
                  type: boolean
                  description: >-
                    Whether secrets should be automatically rotated when the
                    specified rotation interval has elapsed.
                rotationInterval:
                  type: integer
                  minimum: 1
                  maximum: 180
                  description: >-
                    The updated interval, in days, to automatically rotate
                    secrets.
                rotateAtUtc:
                  type: object
                  properties:
                    hours:
                      type: number
                      minimum: 0
                      maximum: 23
                    minutes:
                      type: number
                      minimum: 0
                      maximum: 59
                  required:
                    - hours
                    - minutes
                  additionalProperties: false
                  description: >-
                    The updated hours and minutes rotation should occur at in
                    UTC.
                parameters:
                  type: object
                  properties:
                    groupId:
                      type: string
                      minLength: 1
                      maxLength: 20
                      pattern: ^\d+$
                      description: >-
                        The ID of the GitLab group that owns the service
                        account.
                    serviceAccountId:
                      type: string
                      minLength: 1
                      maxLength: 20
                      pattern: ^\d+$
                      description: >-
                        The user ID of the GitLab service account to create
                        tokens for.
                    name:
                      type: string
                      minLength: 1
                      maxLength: 200
                      description: >-
                        The name for the generated GitLab token. Infisical
                        appends a timestamp so each rotated token is distinct.
                    description:
                      type: string
                      maxLength: 255
                      description: An optional description for the generated GitLab token.
                    scopes:
                      type: array
                      items:
                        type: string
                        enum:
                          - api
                          - read_api
                          - read_user
                          - read_repository
                          - write_repository
                          - read_registry
                          - write_registry
                          - read_virtual_registry
                          - write_virtual_registry
                          - create_runner
                          - manage_runner
                          - ai_features
                          - k8s_proxy
                          - self_rotate
                      minItems: 1
                      description: >-
                        The scopes to grant the generated GitLab token, for
                        example 'api', 'read_api', or 'read_repository'.
                  required:
                    - groupId
                    - serviceAccountId
                    - name
                    - scopes
                  additionalProperties: false
                secretsMapping:
                  type: object
                  properties:
                    tokenId:
                      type: string
                      minLength: 1
                      description: >-
                        The name of the secret that the rotated GitLab token ID
                        will be mapped to.
                    token:
                      type: string
                      minLength: 1
                      description: >-
                        The name of the secret that the rotated GitLab token
                        value will be mapped to.
                  required:
                    - tokenId
                    - token
                  additionalProperties: false
              additionalProperties: false
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  secretRotation:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      name:
                        type: string
                      description:
                        type: string
                        nullable: true
                      isAutoRotationEnabled:
                        type: boolean
                        default: true
                      activeIndex:
                        type: number
                        default: 0
                      folderId:
                        type: string
                        format: uuid
                      connectionId:
                        type: string
                        format: uuid
                      createdAt:
                        type: string
                        format: date-time
                      updatedAt:
                        type: string
                        format: date-time
                      rotationInterval:
                        type: number
                      rotationStatus:
                        type: string
                      lastRotationAttemptedAt:
                        type: string
                        format: date-time
                      lastRotatedAt:
                        type: string
                        format: date-time
                      lastRotationJobId:
                        type: string
                        nullable: true
                      nextRotationAt:
                        type: string
                        format: date-time
                        nullable: true
                      isLastRotationManual:
                        type: boolean
                        default: true
                      connection:
                        type: object
                        properties:
                          app:
                            type: string
                            enum:
                              - gitlab
                          name:
                            type: string
                          id:
                            type: string
                            format: uuid
                        required:
                          - app
                          - name
                          - id
                        additionalProperties: false
                      environment:
                        type: object
                        properties:
                          slug:
                            type: string
                          name:
                            type: string
                          id:
                            type: string
                            format: uuid
                        required:
                          - slug
                          - name
                          - id
                        additionalProperties: false
                      projectId:
                        type: string
                      folder:
                        type: object
                        properties:
                          id:
                            type: string
                          path:
                            type: string
                        required:
                          - id
                          - path
                        additionalProperties: false
                      rotateAtUtc:
                        type: object
                        properties:
                          hours:
                            type: number
                            minimum: 0
                            maximum: 23
                          minutes:
                            type: number
                            minimum: 0
                            maximum: 59
                        required:
                          - hours
                          - minutes
                        additionalProperties: false
                      lastRotationMessage:
                        type: string
                        nullable: true
                      type:
                        type: string
                        enum:
                          - gitlab-service-account-token
                      parameters:
                        type: object
                        properties:
                          groupId:
                            type: string
                            minLength: 1
                            maxLength: 20
                            pattern: ^\d+$
                            description: >-
                              The ID of the GitLab group that owns the service
                              account.
                          serviceAccountId:
                            type: string
                            minLength: 1
                            maxLength: 20
                            pattern: ^\d+$
                            description: >-
                              The user ID of the GitLab service account to
                              create tokens for.
                          name:
                            type: string
                            minLength: 1
                            maxLength: 200
                            description: >-
                              The name for the generated GitLab token. Infisical
                              appends a timestamp so each rotated token is
                              distinct.
                          description:
                            type: string
                            maxLength: 255
                            description: >-
                              An optional description for the generated GitLab
                              token.
                          scopes:
                            type: array
                            items:
                              type: string
                              enum:
                                - api
                                - read_api
                                - read_user
                                - read_repository
                                - write_repository
                                - read_registry
                                - write_registry
                                - read_virtual_registry
                                - write_virtual_registry
                                - create_runner
                                - manage_runner
                                - ai_features
                                - k8s_proxy
                                - self_rotate
                            minItems: 1
                            description: >-
                              The scopes to grant the generated GitLab token,
                              for example 'api', 'read_api', or
                              'read_repository'.
                        required:
                          - groupId
                          - serviceAccountId
                          - name
                          - scopes
                        additionalProperties: false
                      secretsMapping:
                        type: object
                        properties:
                          tokenId:
                            type: string
                            minLength: 1
                            description: >-
                              The name of the secret that the rotated GitLab
                              token ID will be mapped to.
                          token:
                            type: string
                            minLength: 1
                            description: >-
                              The name of the secret that the rotated GitLab
                              token value will be mapped to.
                        required:
                          - tokenId
                          - token
                        additionalProperties: false
                    required:
                      - id
                      - name
                      - folderId
                      - connectionId
                      - createdAt
                      - updatedAt
                      - rotationInterval
                      - rotationStatus
                      - lastRotationAttemptedAt
                      - lastRotatedAt
                      - connection
                      - environment
                      - projectId
                      - folder
                      - rotateAtUtc
                      - type
                      - parameters
                      - secretsMapping
                    additionalProperties: false
                required:
                  - secretRotation
                additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 400
                  message:
                    type: string
                  error:
                    type: string
                  details: {}
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 401
                  message:
                    type: string
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 403
                  message:
                    type: string
                  details: {}
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 404
                  message:
                    type: string
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '422':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 422
                  message: {}
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - error
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 500
                  message:
                    type: string
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.