{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pipeshub/json-schema/pipeshub-oauth-app-list-response-schema.json",
  "title": "OAuthAppListResponse",
  "description": "Paginated list of OAuth apps",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pipeshub-oauth-apps-api-openapi.yml#/components/schemas/OAuthAppListResponse",
  "type": "object",
  "required": [
    "data",
    "pagination"
  ],
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/OAuthAppResponse"
      },
      "description": "List of OAuth apps"
    },
    "pagination": {
      "type": "object",
      "required": [
        "page",
        "limit",
        "total",
        "totalPages"
      ],
      "properties": {
        "page": {
          "type": "integer",
          "description": "Current page number"
        },
        "limit": {
          "type": "integer",
          "description": "Items per page"
        },
        "total": {
          "type": "integer",
          "description": "Total number of items"
        },
        "totalPages": {
          "type": "integer",
          "description": "Total number of pages"
        }
      }
    }
  },
  "$defs": {
    "OAuthAppResponse": {
      "type": "object",
      "description": "OAuth app details (without secret). Fields under `required:` always appear\nin `toAppResponse` (`oauth.app.service.ts`); optional URL/description fields\nare only present when set by the caller.\n",
      "required": [
        "id",
        "slug",
        "clientId",
        "name",
        "redirectUris",
        "allowedGrantTypes",
        "allowedScopes",
        "status",
        "isConfidential",
        "accessTokenLifetime",
        "refreshTokenLifetime",
        "createdAt",
        "updatedAt"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "App ID"
        },
        "slug": {
          "type": "string",
          "description": "URL-friendly app slug"
        },
        "clientId": {
          "type": "string",
          "description": "OAuth client ID"
        },
        "name": {
          "type": "string",
          "description": "App name"
        },
        "description": {
          "type": "string",
          "description": "App description"
        },
        "redirectUris": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          },
          "description": "Allowed redirect URIs (always returned; may be empty)"
        },
        "allowedGrantTypes": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Allowed grant types"
        },
        "allowedScopes": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Allowed scopes"
        },
        "status": {
          "type": "string",
          "enum": [
            "active",
            "suspended",
            "revoked"
          ],
          "description": "App status"
        },
        "homepageUrl": {
          "type": "string",
          "format": "uri",
          "description": "App homepage"
        },
        "privacyPolicyUrl": {
          "type": "string",
          "format": "uri",
          "description": "Privacy policy URL"
        },
        "termsOfServiceUrl": {
          "type": "string",
          "format": "uri",
          "description": "Terms of service URL"
        },
        "isConfidential": {
          "type": "boolean",
          "description": "Whether app is a confidential client"
        },
        "accessTokenLifetime": {
          "type": "integer",
          "description": "Access token lifetime in seconds"
        },
        "refreshTokenLifetime": {
          "type": "integer",
          "description": "Refresh token lifetime in seconds"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "description": "Creation timestamp"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time",
          "description": "Last update timestamp"
        }
      }
    }
  }
}