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

# Update delegation credentials of your organization

> Required membership role: `org admin`. PBAC permission: `organization.update`. Learn more about API access control at https://cal.com/docs/api-reference/v2/access-control



## OpenAPI

````yaml /api-reference/v2/openapi.json patch /v2/organizations/{orgId}/delegation-credentials/{credentialId}
openapi: 3.0.0
info:
  title: Cal.com API v2
  description: ''
  version: 1.0.0
  contact: {}
servers: []
security: []
tags: []
paths:
  /v2/organizations/{orgId}/delegation-credentials/{credentialId}:
    patch:
      tags:
        - Orgs / Delegation Credentials
      summary: Update delegation credentials of your organization
      description: >-
        Required membership role: `org admin`. PBAC permission:
        `organization.update`. Learn more about API access control at
        https://cal.com/docs/api-reference/v2/access-control
      operationId: OrganizationsDelegationCredentialController_updateDelegationCredential
      parameters:
        - name: Authorization
          in: header
          description: >-
            For non-platform customers - value must be `Bearer <token>` where
            `<token>` is api key prefixed with cal_
          required: false
          schema:
            type: string
        - name: x-cal-secret-key
          in: header
          description: For platform customers - OAuth client secret key
          required: false
          schema:
            type: string
        - name: x-cal-client-id
          in: header
          description: For platform customers - OAuth client ID
          required: false
          schema:
            type: string
        - name: orgId
          required: true
          in: path
          schema:
            type: number
        - name: credentialId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDelegationCredentialInput'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateDelegationCredentialOutput'
components:
  schemas:
    UpdateDelegationCredentialInput:
      type: object
      properties:
        enabled:
          type: boolean
        serviceAccountKey:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/GoogleServiceAccountKeyInput'
              - $ref: '#/components/schemas/MicrosoftServiceAccountKeyInput'
    UpdateDelegationCredentialOutput:
      type: object
      properties:
        status:
          type: string
          example: success
          enum:
            - success
            - error
        data:
          $ref: '#/components/schemas/DelegationCredentialOutput'
      required:
        - status
        - data
    GoogleServiceAccountKeyInput:
      type: object
      properties:
        private_key:
          type: string
        client_email:
          type: string
        client_id:
          type: string
      required:
        - private_key
        - client_email
        - client_id
    MicrosoftServiceAccountKeyInput:
      type: object
      properties:
        private_key:
          type: string
        tenant_id:
          type: string
        client_id:
          type: string
      required:
        - private_key
        - tenant_id
        - client_id
    DelegationCredentialOutput:
      type: object
      properties:
        id:
          type: string
        enabled:
          type: boolean
        domain:
          type: string
        organizationId:
          type: number
        workspacePlatform:
          $ref: '#/components/schemas/WorkspacePlatformDto'
        createdAt:
          format: date-time
          type: string
        updatedAt:
          format: date-time
          type: string
      required:
        - id
        - enabled
        - domain
        - organizationId
        - workspacePlatform
        - createdAt
        - updatedAt
    WorkspacePlatformDto:
      type: object
      properties:
        name:
          type: string
        slug:
          type: string
      required:
        - name
        - slug

````