> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# QueryOAuthApps

# Package: headless

# Namespace: OAuthAppService

# Method link: https://dev.wix.com/docs/api-reference/business-management/headless/oauth-apps/query-oauth-apps.md

## Permission Scopes:
Read OAuth Apps: SCOPE.OAUTH_APP.READ

## Introduction

Retrieves a list of OAuth apps, given the provided paging, filtering, and sorting.


Query OAuth Apps runs with these defaults, which you can override:
+ Results are sorted by `id` in descending order.
+ `paging.offset` is `0`.

For field support for filters and sorting, see [OAuth Apps: Supported Filters and Sorting](https://dev.wix.com/docs/rest/business-management/headless-authentication/oauth-apps/filters-sorting.md)

To learn about working with _Query_ endpoints in general, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language).

---

## REST API

### Schema

```
 Method: queryOAuthApps
 Description: Retrieves a list of OAuth apps, given the provided paging, filtering, and sorting.   Query OAuth Apps runs with these defaults, which you can override: + Results are sorted by `id` in descending order. + `paging.offset` is `0`.  For field support for filters and sorting, see [OAuth Apps: Supported Filters and Sorting](https://dev.wix.com/docs/rest/business-management/headless-authentication/oauth-apps/filters-sorting.md)  To learn about working with _Query_ endpoints in general, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language).
 URL: https://www.wixapis.com/oauth-app/v1/oauth-apps/query
 Method: POST
 Method parameters:
   param name: query | type: PlatformQuery    
     - name: paging | type: Paging | description: Paging options to limit and skip the number of items.  
        - name: limit | type: integer | description: Number of items to load.  | validation: minimum 0, format int32
        - name: offset | type: integer | description: Number of items to skip in the current sort order.  | validation: minimum 0, format int32
        - name: filter | type: object | description: Filter object in the following format: `"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }` Example of operators: `$eq`  
        - name: sort | type: array<Sorting> | description: Sort object in the following format: `[{"fieldName":"name","order":"ASC"},{"fieldName":"created_date","order":"DESC"}]`  | validation: maxItems 3
           - name: fieldName | type: string | description: Name of the field to sort by.  | validation: maxLength 512
           - name: order | type: SortOrder | description: Sort order.  
                 - enum: ASC, DESC
           - name: origin | type: AddressLocation | description: Origin point for geo-distance sorting on a GEO field results are ordered by distance from this point (ASC = nearest first, DESC = farthest first).  
              - name: latitude | type: number | description: Address latitude.  | validation: format double
              - name: longitude | type: number | description: Address longitude.  | validation: format double
 Query fields:
   - field: id | operators: $eq | sort: none | aggregatable: undefined | searchable: undefined
   - field: createdDate | operators: none | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: name | operators: none | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
 Return type: QueryOAuthAppsResponse
  - name: oAuthApps | type: array<OAuthApp> | description: List of OAuth apps matching the query.  
     - name: id | type: string | description: GUID of the OAuth app.  | read-only: true | validation: format GUID
     - name: createdDate | type: string | description: Date and time the OAuth app was created, in ISO 8601 format.  | read-only: true | validation: format date-time
     - name: name | type: string | description: Display name of the OAuth app, as it appears in the dashboard.  | validation: minLength 2, maxLength 256
     - name: description | type: string | description: Description of the OAuth app, as it appears in the dashboard.  
     - name: loginUrl | type: string | description: External login URL to which users are redirected automatically to authenticate. If no login URL is specified, the user is redirected to Wix to authenticate.  | validation: format WEB_URL
     - name: allowedRedirectUris | type: array<string> | description: List of URIs to which redirection from Wix is allowed after authentication.  When a client redirects a user to Wix for authentication, the client provides a URI to redirect the user back to after the user has been authenticated. Wix only redirects the user if the exact URI is contained in this array.  | validation: maxItems 50, format URI
     - name: allowedRedirectDomains | type: array<string> | description: List of domains to which redirection from Wix is allowed after processes other than authentication.  When a client redirects a user to a Wix page (for example, for checkout), the client provides a URL to redirect the user back to. Wix only redirects the user if the URL is in one of the specified domains.  | validation: maxItems 50
     - name: allowSecretGeneration | type: boolean | description: For internal use only.  
     - name: logoutUrl | type: string | description: External logout URL to which we invoke when user logout at wix. If no logout URL is specified, the user is logged out only at Wix.  | validation: format WEB_URL
     - name: applicationType | type: OAuthAppType | description: OAuth application type.  
         - enum:
         -     OAUTH_APP_TYPE_UNSPECIFIED: OAuth app type is not specified.
         -     WEB_APP: OAuth app type is a web application.
         -     MOBILE: OAuth app type is a mobile application.
         -     OTHER: OAuth app type is some other type of application.
     - name: technology | type: OAuthTechnologies | description: OAuth technology used by the oauth application.  
         - enum:
         -     OAUTH_TECHNOLOGY_UNSPECIFIED: The OAuth technology is not specified.
         -     JAVASCRIPT: OAuth technology using JavaScript.
         -     ANGULAR: OAuth technology using Angular.
         -     VUE: OAuth technology using Vue.js.
         -     REACT: OAuth technology using React.
         -     REACT_NATIVE: OAuth technology using React Native.
         -     IOS: OAuth technology using iOS.
         -     ANDROID: OAuth technology using Android.
         -     OTHER_TECHNOLOGY: OAuth technology using some other kind of technology.
     - name: wixPagesDomainsMappings | type: array<WixPagesDomainMapping> | description: List of domain mappings from external domains to Wix domains. When a user accesses a non-Wix domain, they can be automatically forwarded to the corresponding Wix domain based on these mappings. This enables domain-level redirection from external domains to Wix-hosted pages.  | validation: maxItems 200
        - name: origin | type: string | description:   | validation: maxLength 2048
        - name: destination | type: string | description:   | validation: maxLength 2048
     - name: redirectUrlWixPages | type: string | description: Redirect url for Wix-hosted pages.  | validation: maxLength 1024
  - name: pagingMetadata | type: PagingMetadataV2 | description: Paging metadata.  
     - name: count | type: integer | description: Number of items returned in the response.  | validation: format int32
     - name: offset | type: integer | description: Offset that was requested.  | validation: format int32
     - name: total | type: integer | description: Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set.  | validation: format int32
     - name: tooManyToCount | type: boolean | description: Flag that indicates the server failed to calculate the `total` field.  
     - name: cursors | type: Cursors | description: Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used.  
        - name: next | type: string | description: Cursor string pointing to the next page in the list of results.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor pointing to the previous page in the list of results.  | validation: maxLength 16000


```

### Examples

### Query for OAuth apps
```curl
curl -X POST \
'https://www.wixapis.com/oauth-app/v1/oauth-apps/query' \
-H 'Authorization: <AUTH> \
-H 'Content-Type: application/json' \
-d '{
  "query": {
    "sort": []
  }
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.authManagement.oAuthApps.queryOAuthApps(query)
 Description: Retrieves a list of OAuth apps, given the provided paging, filtering, and sorting.   Query OAuth Apps runs with these defaults, which you can override: + Results are sorted by `id` in descending order. + `paging.offset` is `0`.  For field support for filters and sorting, see [OAuth Apps: Supported Filters and Sorting](https://dev.wix.com/docs/rest/business-management/headless-authentication/oauth-apps/filters-sorting.md)  To learn about working with _Query_ endpoints in general, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language).
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  query
 Method parameters: 
   param name: query | type: OAuthAppQuery   | required: true 
     - name: paging | type: Paging | description: Paging options to limit and skip the number of items.  
        - name: limit | type: integer | description: Number of items to load.  | validation: minimum 0, format int32
        - name: offset | type: integer | description: Number of items to skip in the current sort order.  | validation: minimum 0, format int32
        - name: filter | type: object | description: Filter object in the following format: `"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }` Example of operators: `$eq`  
        - name: sort | type: array<Sorting> | description: Sort object in the following format: `[{"fieldName":"name","order":"ASC"},{"fieldName":"created_date","order":"DESC"}]`  | validation: maxItems 3
           - name: fieldName | type: string | description: Name of the field to sort by.  | validation: maxLength 512
           - name: order | type: SortOrder | description: Sort order.  
                 - enum: ASC, DESC
           - name: origin | type: AddressLocation | description: Origin point for geo-distance sorting on a GEO field results are ordered by distance from this point (ASC = nearest first, DESC = farthest first).  
              - name: latitude | type: number | description: Address latitude.  
              - name: longitude | type: number | description: Address longitude.  
 Query fields:
   - field: _id | operators: $eq | sort: none | aggregatable: undefined | searchable: undefined
   - field: _createdDate | operators: none | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: name | operators: none | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
 Return type: PROMISE<QueryOAuthAppsResponse>
  - name: oAuthApps | type: array<OAuthApp> | description: List of OAuth apps matching the query.  
     - name: _id | type: string | description: GUID of the OAuth app.  | read-only: true | validation: format GUID
     - name: _createdDate | type: Date | description: Date and time the OAuth app was created, in ISO 8601 format.  | read-only: true 
     - name: name | type: string | description: Display name of the OAuth app, as it appears in the dashboard.  | validation: minLength 2, maxLength 256
     - name: description | type: string | description: Description of the OAuth app, as it appears in the dashboard.  
     - name: loginUrl | type: string | description: External login URL to which users are redirected automatically to authenticate. If no login URL is specified, the user is redirected to Wix to authenticate.  | validation: format WEB_URL
     - name: allowedRedirectUris | type: array<string> | description: List of URIs to which redirection from Wix is allowed after authentication.  When a client redirects a user to Wix for authentication, the client provides a URI to redirect the user back to after the user has been authenticated. Wix only redirects the user if the exact URI is contained in this array.  | validation: maxItems 50, format URI
     - name: allowedRedirectDomains | type: array<string> | description: List of domains to which redirection from Wix is allowed after processes other than authentication.  When a client redirects a user to a Wix page (for example, for checkout), the client provides a URL to redirect the user back to. Wix only redirects the user if the URL is in one of the specified domains.  | validation: maxItems 50
     - name: allowSecretGeneration | type: boolean | description: For internal use only.  
     - name: logoutUrl | type: string | description: External logout URL to which we invoke when user logout at wix. If no logout URL is specified, the user is logged out only at Wix.  | validation: format WEB_URL
     - name: applicationType | type: OAuthAppType | description: OAuth application type.  
         - enum:
         -     OAUTH_APP_TYPE_UNSPECIFIED: OAuth app type is not specified.
         -     WEB_APP: OAuth app type is a web application.
         -     MOBILE: OAuth app type is a mobile application.
         -     OTHER: OAuth app type is some other type of application.
     - name: technology | type: OAuthTechnologies | description: OAuth technology used by the oauth application.  
         - enum:
         -     OAUTH_TECHNOLOGY_UNSPECIFIED: The OAuth technology is not specified.
         -     JAVASCRIPT: OAuth technology using JavaScript.
         -     ANGULAR: OAuth technology using Angular.
         -     VUE: OAuth technology using Vue.js.
         -     REACT: OAuth technology using React.
         -     REACT_NATIVE: OAuth technology using React Native.
         -     IOS: OAuth technology using iOS.
         -     ANDROID: OAuth technology using Android.
         -     OTHER_TECHNOLOGY: OAuth technology using some other kind of technology.
     - name: wixPagesDomainsMappings | type: array<WixPagesDomainMapping> | description: List of domain mappings from external domains to Wix domains. When a user accesses a non-Wix domain, they can be automatically forwarded to the corresponding Wix domain based on these mappings. This enables domain-level redirection from external domains to Wix-hosted pages.  | validation: maxItems 200
        - name: origin | type: string | description:   | validation: maxLength 2048
        - name: destination | type: string | description:   | validation: maxLength 2048
     - name: redirectUrlWixPages | type: string | description: Redirect url for Wix-hosted pages.  | validation: maxLength 1024
  - name: pagingMetadata | type: PagingMetadataV2 | description: Paging metadata.  
     - name: count | type: integer | description: Number of items returned in the response.  | validation: format int32
     - name: offset | type: integer | description: Offset that was requested.  | validation: format int32
     - name: total | type: integer | description: Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set.  | validation: format int32
     - name: tooManyToCount | type: boolean | description: Flag that indicates the server failed to calculate the `total` field.  
     - name: cursors | type: Cursors | description: Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used.  
        - name: next | type: string | description: Cursor string pointing to the next page in the list of results.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor pointing to the previous page in the list of results.  | validation: maxLength 16000


```

### Examples

### queryOAuthApps
```javascript
import { oAuthApps } from '@wix/auth-management';

async function queryOAuthApps(query) {
  const response = await oAuthApps.queryOAuthApps(query);
};
```

### queryOAuthApps (with elevated permissions)
```javascript
import { oAuthApps } from '@wix/auth-management';
import { auth } from '@wix/essentials';

async function myQueryOAuthAppsMethod(query) {
  const elevatedQueryOAuthApps = auth.elevate(oAuthApps.queryOAuthApps);
  const response = await elevatedQueryOAuthApps(query);
}
```

### queryOAuthApps (self-managed)
Self-managed SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { oAuthApps } from '@wix/auth-management';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { oAuthApps },
  // Include the auth strategy and host as relevant
});


async function queryOAuthApps(query) {
  const response = await myWixClient.oAuthApps.queryOAuthApps(query);
};
```

---