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

# Update OAuth Application

> ⚠️ SECURITY: Only OWNERS and ADMINS can update OAuth applications. Allows updating name, scopes, redirect URIs, and status. Client ID and secret cannot be changed.

Updates an OAuth application configuration. Only **OWNERS** and **ADMINS** can update OAuth applications.

<Info>
  Client ID and secret cannot be changed. Only name, description, redirect URI,
  scopes, and status can be updated.
</Info>

## Permissions

Only **OWNERS** and **ADMINS** can update OAuth applications.

## Path Parameters

| Parameter  | Type   | Required | Description                 |
| ---------- | ------ | -------- | --------------------------- |
| `clientId` | string | Yes      | OAuth application client ID |

## Request Body

| Field         | Type    | Required | Description                                  |
| ------------- | ------- | -------- | -------------------------------------------- |
| `name`        | string  | No       | Application name (max 100 characters)        |
| `description` | string  | No       | Application description (max 500 characters) |
| `redirectUri` | string  | No       | Redirect URI for OAuth flow                  |
| `scopes`      | array   | No       | OAuth scopes requested                       |
| `isActive`    | boolean | No       | Whether the application is active            |

## Example Request

```bash theme={null}
curl -X PUT http://localhost:3001/api/oauth/apps/app_1234567890abcdef \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Integration Name",
    "scopes": ["read:organization", "write:organization", "read:webhooks"],
    "isActive": true
  }'
```

## Example Response

```json theme={null}
{
  "clientId": "app_1234567890abcdef",
  "name": "Updated Integration Name",
  "description": "Integration for managing organization data",
  "redirectUri": "https://example.com/callback",
  "scopes": ["read:organization", "write:organization", "read:webhooks"],
  "isActive": true,
  "updatedAt": "2025-01-26T11:00:00Z"
}
```

## Common Errors

### 400 Bad Request

Invalid input data or validation errors.

### 401 Unauthorized

Authentication required.

### 403 Forbidden

Only owners and admins can update OAuth applications.

### 404 Not Found

OAuth application not found with the provided client ID.


## OpenAPI

````yaml PUT /oauth/apps/{clientId}
openapi: 3.1.0
info:
  title: Timbrix API
  description: >-
    REST API with OAuth2 server for managing organizations, members, and
    webhooks
  version: '1.0'
  contact: {}
servers:
  - url: http://sandbox.mintlify.com
    description: Sandbox environment
  - url: http://localhost:3001/api
    description: Local development
security: []
tags:
  - name: organizations
    description: Organization management endpoints
  - name: oauth
    description: OAuth2 authentication and authorization
  - name: webhooks
    description: Webhook configuration and delivery
  - name: users
    description: User information endpoints
  - name: api-keys
    description: API Keys management and validation
paths:
  /oauth/apps/{clientId}:
    put:
      tags:
        - oauth
      summary: Update OAuth application
      description: >-
        ⚠️ SECURITY: Only OWNERS and ADMINS can update OAuth applications.
        Allows updating name, scopes, redirect URIs, and status. Client ID and
        secret cannot be changed.
      operationId: OAuthController_updateApp
      parameters:
        - name: clientId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOAuthAppDto'
      responses:
        '200':
          description: Application updated successfully with new configuration.
        '400':
          description: Invalid input data. Check validation errors.
        '401':
          description: Authentication required. Provide a valid bearer token.
        '403':
          description: Access denied. Only owners and admins can update OAuth applications.
        '404':
          description: OAuth application not found with the provided client ID.
      security:
        - bearer: []
components:
  schemas:
    UpdateOAuthAppDto:
      type: object
      properties:
        name:
          type: string
          description: Application name
          example: My Integration
          maxLength: 100
        description:
          type: string
          description: Application description
          example: Integration for managing organization data
          maxLength: 500
        redirectUri:
          type: string
          description: Redirect URI for OAuth flow
          example: https://example.com/callback
        scopes:
          description: OAuth scopes requested
          example:
            - read:organization
            - write:organization
          type: array
          items:
            type: array
        isActive:
          type: boolean
          description: Whether the application is active
          example: true
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````