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

# <access-service>/api/v1/organisations

## URL structure&#x20;

```text theme={null}
https://access-service.xy-company.com/api/v1/organisations
```

## Supported methods and overview&#x20;

* `POST` - used to add a new [organization](/3.3/admin-platform/administering-organisations.md) to the Covata Platform.
* `GET` - used to retrieve information about all organizations configured on the Covata Platform.

## Detailed description&#x20;

This API endpoint serves a number of purposes:

* Adds a new organization to the Covata Platform.
* Retrieves information about all organizations configured on the Covata Platform.

## Supported roles and conditions&#x20;

This API endpoint supports the following Covata user [roles](/3.3/admin-platform/administering-platform-administrator-users.md#platform-administrators-and-user-roles) (as described in the [Safe Share Administrator's Guide](/3.3/admin-platform.md)):

* [Safe Share administrator](/3.3/admin-platform/administering-platform-administrator-users.md#platform-administrator-role) - using the:

  * `POST` method, when no LDAP connection has been configured on the Covata Platform. To retrieve information about all configured LDAP connections on the Covata Platform, see [\<access-service>/api/v1/ldapconnections](/3.3/api/access-service-api-v1-ldapconnections.md).
  * `GET` method, without any futher conditions.

The Covata Platform's resources available to a Covata user meeting the criteria above is determined by the access token submitted in the [header](/3.3/api/access-service-api-v1-organisations.md#access-service-api-v1-organisations-required-headers) of requests to this endpoint.

## Required headers&#x20;

The appropriate access token as the `Bearer` token:

* `Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE0NjcwMTY2NjYsInVzZXJfbmFtZSI6ImFsZXgub...`

The following header is required if the body of the request has a JSON object:

* `Content-Type: application/json`

## Required POST-request parameters&#x20;

The following required parameters must be sent in the **body** of the POST request, each as individual members of a **JSON object**:

* **name** - The initial name for the new organization.
* **quota** - The initial quota for the organization (in MiB). \

  **Note:** A *MiB* is a [mebibyte](http://physics.nist.gov/cuu/Units/binary.html), where one MiB = 1 x 1024 x 1024 bytes = 1048576 bytes.
* **adminEmail** - The email address of the initial [Organization administrator](/3.3/admin-org/administering-users-within-an-organisation.md#organisation-administrator-role) of this organization.
* **contactEmail** - The email address of the initial **Contact Person** of this organization. \

  **Notes:**

  * This property appears under the name [The email address of the organization's contact person](/3.3/admin-org/configuring-organisation-administration-properties.md#organisations-contact-person) on the [Configuration](/3.3/admin-org/configuring-organisation-administration-properties.md) page in Organization Administration.
  * When [adding a new organization](/3.3/admin-platform/administering-organisations.md#adding-a-new-organisation) through Safe Share Administration, both this property and the **adminEmail** property (above) are set with the same value. However, this API endpoint provides the ability to set these two properties with different email addresses (in a single request to this API).

  **Example (request):**

  ```json theme={null}
  {
    "name": "Another Org.",
    "quota": 2094080,
    "adminEmail": "org.administrator@xy-company.com",
    "contactEmail": "org.administrator@xy-company.com"
  }
  ```

## Optional POST-request parameters&#x20;

The following optional parameters can be sent in the **body** of the POST request, each as individual members of the **JSON object** that includes the [Required POST-request parameters](/3.3/api/access-service-api-v1-organisations.md#access-service-api-v1-organisations-required-post-request-parameters) above:

* **description** - The initial description for the new organization. \

  **Note:** This property appears under the name **A brief description of the organization** on the **Configuration** page in Organization Administration. However, as described in the [Configuring Safe Share Organization Administration properties](/3.3/admin-org/configuring-organisation-administration-properties.md) page of the Organization Administrator's Guide, this property is currently of limited use. \

  **Example (request):**

  ```json theme={null}
  {
    "name": "Another Org.",
    "description": "The brief description for Another Org.",
    "quota": 2094080,
    "adminEmail": "org.administrator@xy-company.com",
    "contactEmail": "org.administrator@xy-company.com"
  }
  ```

## Optional GET-request parameters&#x20;

The following optional parameters can be sent in the **URL** of the GET request:

* **limit** - An integer value from `0` to `100`, representing the maximum number of items to be returned in the response, where an individual item is information about an organization configured on the Covata Platform. If this parameter is omitted, then its value is `0` by default, which does not apply restrictions to the number of items returned in the response.
* **offset** - A value representing the count order of all retrievable items (i.e. organizations configured on the Covata Platform) returned in the response. Calls to this API endpoint may amount to potentially large numbers of items being returned from the Covata Platform. Since the order of these items in the response could differ significantly, based on the values of the **orderBy** and **sortBy** parameters below, this **offset** parameter provides pagination for items returned in responses, allowing items to be retrieved from any count greater than `0` (i.e. the first item returned in a response). If this parameter is omitted, then its value is `0` by default.
* **orderBy** - An enumeration (enum) value representing the order in which items (i.e. organizations configured on the Covata Platform) are returned in the response. This parameter orders items according to the value of the **sortBy** parameter specified below. Ordering items can be in either ascending alphanumeric order (by specifying the value `ASC` for this parameter) or descending order (by specifying the value `DESC`). If this parameter is omitted, then its value is `ASC` by default.
* **sortBy** - A value representing the field (i.e. member) of a retrieved item by which items (i.e. organizations configured on the Covata Platform) returned in the response will be sorted. Valid field values for this parameter include:

  * `id` - the ID of the organization,
  * `name` - the name of the organization,
  * `contact_email` - the email address of the organization's Contact Person,
  * `quota` - the name of the organization and
  * `description` - the description of the organization.

  **Example (request):**

  ```text theme={null}
  https://access-service.xy-company.com/api/v1/organisations?sortBy=name
  ```

## Returns&#x20;

If the request succeeded, then an HTTP response status `200 OK` is returned.

For successful requests only, a JSON-formatted response containing the following members is also returned:

* **items** - .
* **name** - .
* **description** - .
* **quota** - .
* **contactEmail** - .
* **enabled** - .
* **id** - .
* **modifiedAt** - .
* **createdAt** - .
* **count** - .
* **offset** - . \

  **Example (response from a POST request):**

  ```json theme={null}
  {
      "name": "Another Org.",
      "description": "The brief description for Another Org.",
      "quota": 2094080,
      "contactEmail": "org.administrator@xy-company.com",
      "enabled": true,
      "id": "769407354122051584",
      "modifiedAt": "2016-10-24T03:50:08.120Z",
      "createdAt": "2016-10-24T03:50:08.120Z"
  }
  ```

  **Example (response from a GET request):**

  ```json theme={null}
  {
      "items": [{
          "name": "Default",
          "description": "",
          "quota": 0,
          "contactEmail": "",
          "enabled": true,
          "id": "1",
          "modifiedAt": "1970-01-01T00:00:00.000Z",
          "createdAt": "1970-01-01T00:00:00.000Z"
      }, {
          "name": "XY Company",
          "description": "",
          "quota": 4194304,
          "contactEmail": "org.administrator@xy-company.com",
          "enabled": true,
          "id": "760756644367081472",
          "modifiedAt": "2016-10-10T06:34:19.254Z",
          "createdAt": "2016-09-30T06:55:18.192Z"
      }],
      "count": "2",
      "offset": "0"
  }
  ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.