# Organization

{% hint style="info" %}
An `Organization` instance represents an Aragon organization and exposes methods to interact with it.
{% endhint %}

## Methods

### Organization#app(appFilter)

Fetch a specific app from the organization.

| Name                | Type                          | Description                                                                                                                                                                                                                                                   |
| ------------------- | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `appFilter`         | `String` or object (optional) | When a string is passed, the app will get searched by address if it starts by `0x`, and by `appName` otherwise. See `appFilter.address` and `appFilter.appName` to set them explicitly. For the time being, only one type of filter can get passed at a time. |
| `appFilter.address` | `String`                      | Same as `appFilter`, but makes the selection by `address` explicit.                                                                                                                                                                                           |
| `appFilter.appName` | `String`                      | Same as `appFilter`, but makes the selection by `appName` explicit.                                                                                                                                                                                           |
| returns             | `Promise<App>`                | A promise resolving to an app.                                                                                                                                                                                                                                |

This method can throw one of the following errors:

| Error type                                                                                                | Description                                 |
| --------------------------------------------------------------------------------------------------------- | ------------------------------------------- |
| [`ErrorNotFound`](/developers/tools/aragon-connect/api-reference/errors.md#errornotfound)                 | No app found.                               |
| [`ErrorUnexpectedResult`](/developers/tools/aragon-connect/api-reference/errors.md#errorunexpectedresult) | The data couldn’t be fetched.               |
| [`ErrorConnection`](/developers/tools/aragon-connect/api-reference/errors.md#errorconnection)             | The connection to the remote source failed. |

### Organization#onApp(appFilter, callback)

Like `Organization#app()`, but as a subscription.

| Name                | Type                               | Description                                                                                                                                                                                                                                                   |
| ------------------- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `appFilter`         | `String` or object (optional)      | When a string is passed, the app will get searched by address if it starts by `0x`, and by `appName` otherwise. See `appFilter.address` and `appFilter.appName` to set them explicitly. For the time being, only one type of filter can get passed at a time. |
| `appFilter.address` | `String`                           | Same as `appFilter`, but makes the selection by `address` explicit.                                                                                                                                                                                           |
| `appFilter.appName` | `String`                           | Same as `appFilter`, but makes the selection by `appName` explicit.                                                                                                                                                                                           |
| `callback`          | `(error: Error, app: App) => void` | A callback that will get called every time the result gets updated.                                                                                                                                                                                           |
| returns             | `{ unsubscribe: () => void }`      | A handler that allows to stop receiving updates.                                                                                                                                                                                                              |

The error passed to `callback` can be `null` (no error) or one of the following:

| Error type                                                                                                | Description                                 |
| --------------------------------------------------------------------------------------------------------- | ------------------------------------------- |
| [`ErrorNotFound`](/developers/tools/aragon-connect/api-reference/errors.md#errornotfound)                 | No app found.                               |
| [`ErrorUnexpectedResult`](/developers/tools/aragon-connect/api-reference/errors.md#errorunexpectedresult) | The data couldn’t be fetched.               |
| [`ErrorConnection`](/developers/tools/aragon-connect/api-reference/errors.md#errorconnection)             | The connection to the remote source failed. |

### Organization#apps(appFilter)

Fetch apps from the organization.

| Name                | Type                                        | Description                                                                                                                                                                                                                                                                                                                        |
| ------------------- | ------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `appFilter`         | `String` or `String[]` or object (optional) | When a string is passed, apps will get filtered by address if it starts by `0x`, and by `appName` otherwise. When an array is passed, the first entry determines the type of filter. See `appFilter.address` and `appFilter.appName` to set them explicitly. For the time being, only one type of filter can get passed at a time. |
| `appFilter.address` | `String` or `String[]`                      | Same as `appFilter`, but makes the selection by `address` explicit.                                                                                                                                                                                                                                                                |
| `appFilter.appName` | `String` or `String[]`                      | Same as `appFilter`, but makes the selection by `appName` explicit.                                                                                                                                                                                                                                                                |
| returns             | `Promise<App[]>`                            | A promise resolving to the current list of apps.                                                                                                                                                                                                                                                                                   |

This method can throw one of the following errors:

| Error type                                                                                                                                                   | Description                                 |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------- |
| [`ErrorUnexpectedResult`](https://github.com/aragon/documentation/blob/legacy_docs/developers/tools/aragon-connect/api-reference/broken-reference/README.md) | The data couldn’t be fetched.               |
| [`ErrorConnection`](/developers/tools/aragon-connect/api-reference/errors.md#errorconnection)                                                                | The connection to the remote source failed. |

### Organization#onApps(appFilter, callback)

Like `Organization#apps()`, but as a subscription.

| Name                | Type                                        | Description                                                                                                                                                                                                                                                                                                                        |
| ------------------- | ------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `appFilter`         | `String` or `String[]` or object (optional) | When a string is passed, apps will get filtered by address if it starts by `0x`, and by `appName` otherwise. When an array is passed, the first entry determines the type of filter. See `appFilter.address` and `appFilter.appName` to set them explicitly. For the time being, only one type of filter can get passed at a time. |
| `appFilter.address` | `String` or `String[]`                      | Same as `appFilter`, but makes the selection by `address` explicit.                                                                                                                                                                                                                                                                |
| `appFilter.appName` | `String` or `String[]`                      | Same as `appFilter`, but makes the selection by `appName` explicit.                                                                                                                                                                                                                                                                |
| `callback`          | `(error: Error, app:App) => void`           | A callback that will get called every time the result gets updated.                                                                                                                                                                                                                                                                |
| returns             | `{ unsubscribe: () => void }`               | A handler that allows to stop receiving updates.                                                                                                                                                                                                                                                                                   |

The error passed to `callback` can be `null` (no error) or one of the following:

| Error type                                                                                                | Description                                 |
| --------------------------------------------------------------------------------------------------------- | ------------------------------------------- |
| [`ErrorUnexpectedResult`](/developers/tools/aragon-connect/api-reference/errors.md#errorunexpectedresult) | The data couldn’t be fetched.               |
| [`ErrorConnection`](/developers/tools/aragon-connect/api-reference/errors.md#errorconnection)             | The connection to the remote source failed. |

### Organization#permissions()

Fetch the organization’s permissions.

| Name    | Type                    | Description                             |
| ------- | ----------------------- | --------------------------------------- |
| returns | `Promise<Permission[]>` | A promise resolving to a `Permissions`. |

This method can throw one of the following errors:

| Error type                                                                                                                                                   | Description                                 |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------- |
| [`ErrorUnexpectedResult`](https://github.com/aragon/documentation/blob/legacy_docs/developers/tools/aragon-connect/api-reference/broken-reference/README.md) | The data couldn’t be fetched.               |
| [`ErrorConnection`](https://github.com/aragon/documentation/blob/legacy_docs/developers/tools/aragon-connect/api-reference/broken-reference/README.md)       | The connection to the remote source failed. |

### Organization#onPermissions(callback)

Like `Organization#permissions()`, but as a subscription.

| Name       | Type                                             | Description                                                         |
| ---------- | ------------------------------------------------ | ------------------------------------------------------------------- |
| `callback` | `(error: Error, permission: Permission) => void` | A callback that will get called every time the result gets updated. |
| returns    | `{ unsubscribe: () => void }`                    | A handler that allows to stop receiving updates.                    |

The error passed to `callback` can be `null` (no error) or one of the following:

| Error type                                                                                                | Description                                 |
| --------------------------------------------------------------------------------------------------------- | ------------------------------------------- |
| [`ErrorUnexpectedResult`](/developers/tools/aragon-connect/api-reference/errors.md#errorunexpectedresult) | The data couldn’t be fetched.               |
| [`ErrorConnection`](/developers/tools/aragon-connect/api-reference/errors.md#errorconnection)             | The connection to the remote source failed. |

### Organization#appIntent(appAddress, funcName, funcArgs)

Execute a function on a given app.

| Name         | Type                         | Description                                             |
| ------------ | ---------------------------- | ------------------------------------------------------- |
| `appAddress` | `String`                     | Address of the app instance.                            |
| `funcName`   | `String`                     | Name of the function to call.                           |
| `funcArgs`   | `String`                     | Parameters to pass to the function.                     |
| returns      | `Promise<TransactionIntent>` | A promise resolving to an `TransactionIntent` instance. |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://legacy-docs.aragon.org/developers/tools/aragon-connect/api-reference/organization.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
