---
title: "Organization"
description: "Organization"
url: "https://www.contentstack.com/docs/developers/sdks/content-management-sdk/java/reference/organization"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-09-20"
---

# Organization

## Organization

The Organization is the top-level entity in the hierarchy of Contentstack, consisting of stacks and stack resources and users. The Organization allows easy management of projects and users within the organization.

## roles

Gets organization roles.

Below are the parameters to use in the method - addParam(String, Object):

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Organisation organisation = contentstack.organisation();
Call&lt;ResponseBody&gt; response = organisation.roles().execute();
if (response.isSuccessful){
	System.out.println("Response"+ response)
}
```

The limit parameter will return a specific number of Organization roles in the output. Example, if there are 10 organization roles, and you wish to fetch only the first 2, you need to specify '2' as the value in this parameter.

The 'skip' parameter will skip a specific number of organization roles in the output. For example, if there are 12 organization roles and you want to skip the last 2 to get only the first 10 in the response body, you need to specify '2' here.

The "asc" parameter allows you to sort the list of organization roles in ascending order based on a parameter.

The "desc" parameter allows you to sort the list of organization roles in descending order based on a parameter.

The "include\_count" parameter returns an organization's total number of roles. For example: If you want to know the total number of roles in an organization, you need to put the value as true.

The include\_stack\_roles parameter, when set to true, includes the details of stack-level roles in the Response body.

## stacks

The "Get all stacks" in an organization call fetches the list of all stacks in an Organization

The query parameters for the method - addParam(String, Object) are as follows:

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Organisation organisation = contentstack.organisation();
Call&lt;ResponseBody&gt; response = organisation.stacks().execute();
if (response.isSuccessful){
	System.out.println("Response"+ response)
}
```

The 'limit' parameter will return a specific number of sent organization invitations in the output. Example, if 10 invitations were sent out and you wish to fetch only the first 8, you need to specify '2' as the value in this parameter.

The 'skip' parameter will skip a specific number of organization roles in the output. Example, if there are 12 organization roles and you want to skip the last 2 to get only the first 10 in the response body, you need to specify '2' here.

The 'asc' parameter allows you to sort the list of organization invitations in ascending order on the basis of a specific parameter.

The 'desc' parameter allows you to sort the list of organization invitations in descending order on the basis of a specific parameter.

The 'include\_count' parameter returns the number of organization invitations sent out. Example: If you wish to know the total number of organization invitations, you need to mention 'true'.

The 'typeahead' parameter allows you to perform a name-based search on all the stacks in an organization based on the value provided.

## find

The "Get all organizations" call lists all organizations related to the system user in the order that they were created

Following are the query parameters for the method - addParam(String, Object):

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Organisation organisation = contentstack.organisation();
Call&lt;ResponseBody&gt; response = organisation.find().execute();
if (response.isSuccessful){
	System.out.println("Response"+ response)
}
```

The limit parameter will return a specific number of Organization roles in the output. Example, if there are 10 organization roles, and you wish to fetch only the first 2, you need to specify '2' as the value in this parameter.

The 'skip' parameter will skip a specific number of organization roles in the output. For example, if there are 12 organization roles and you want to skip the last 2 to get only the first 10 in the response body, you need to specify '2' here.

The "asc" parameter allows you to sort the list of organization roles in ascending order based on a parameter.

The "desc" parameter allows you to sort the list of organization roles in descending order based on a parameter.

The "include\_count" parameter returns an organization's total number of roles. For example: If you want to know the total number of roles in an organization, you need to put the value as true.

"contentstack".

## allInvitations

The "Get all organization invitations" call gives you a list of all the Organization invitations. Only the owner or the admin of the Organization can resend the invitation to add users to an Organization.

When executing the API call, provide the Organization UID.

The query parameters for addParam(String, Object) are as follows:

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Organisation organisation = contentstack.organisation();
Call&lt;ResponseBody&gt; response = organisation.allInvitations().execute();
if (response.isSuccessful){
	System.out.println("Response"+ response)
}
```

The 'limit' parameter will return a specific number of sent organization invitations in the output. Example, if 10 invitations were sent out and you wish to fetch only the first 8, you need to specify '2' as the value in this parameter.

The 'skip' parameter will skip a specific number of organization roles in the output. For example, if there are 12 organization roles and you want to skip the last 2 to get only the first 10 in the response body, you need to specify '2' here.

The 'asc' parameter allows you to sort the list of organization invitations in ascending order based on a specific parameter.

The 'desc' parameter allows you to sort the list of organization invitations in descending order on the basis of a specific parameter.

The 'include\_count' parameter returns the total number of organization invitations sent out. Example: If you wish to know the total number of organization invitations, you need to mention 'true'.

The 'include\_roles' parameter, when set to 'true', will display the details of the roles that are assigned to the user in an organization.

The 'include\_invited\_by' parameter, when set to 'true', includes the details of the user who sent out the organization invitation.

The 'include\_user\_details' parameter, when set to 'true', lets you know whether the user who has been sent the organization invitation has enabled Two-factor Authentication or not.

## transferOwnership

The "Transfer organization ownership" call transfers the ownership of an Organization to another user. When the call is executed, an email invitation for accepting the ownership of a particular Organization is sent to the specified user.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Organisation organisation = contentstack.organisation();
Call&lt;ResponseBody&gt; response = organisation.transferOwnership(body).execute();
if (response.isSuccessful){
	System.out.println("Response"+ response)
}
```

The request body.

## logsDetails

The "Get Organization log details" request is used to retrieve the audit log details of an organization

**Tip**: This request returns only the first 25 audit log items of the specified organization. If you get more than 25 items in your response, refer to the Pagination section to retrieve all the log items in paginated form.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Organisation organisation = contentstack.organisation();
Call&lt;ResponseBody&gt; response = organisation.logsDetails().execute();
if (response.isSuccessful){
	System.out.println("Response"+ response)
}
```

## logItem

The" Get Organization log details" request is used to retrieve the audit log details of an organization

**Tip**: This request returns only the first 25 audit log items of the specified organization. If you get more than 25 items in your response, refer to the Pagination section to retrieve all the log items in paginated form

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Organisation organisation = contentstack.organisation();C
all&lt;ResponseBody&gt; response = organisation.LogItem("logUid").execute();
if (response.isSuccessful){
	System.out.println("Response"+ response)
}
```

The log uid.

## resendInvitation

Resend pending organization invitation call allows you to resend Organization invitations to users who have not yet accepted the earlier invitation.

Only the owner or the admin of the Organization can resend the invitation to add users to an Organization.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Organisation organisation = contentstack.organisation();
Call&lt;ResponseBody&gt; response = organisation.resendInvitation("shareUid").execute();
if (response.isSuccessful){
	System.out.println("Response"+ response)
}
```

The share uid.

## removeUsers

The "Remove Users from Organization" request allows you to remove existing users from your organization.

**Note**: Only the owner or the admin of the organization can remove users.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Organisation organisation = contentstack.organisation();
Call&lt;ResponseBody&gt; response = organisation.removeUsers(body).execute();
if (response.isSuccessful){
	System.out.println("Response"+ response)
}
```

The request body in JSONObject format.

## inviteUser

The "Add Users to organization" call allows you to send invitations to add users to your organization. Only the owner or the admin of the organization can add users.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Organisation organisation = contentstack.organisation();
Call&lt;ResponseBody&gt; response = organisation.inviteUser(body).execute();
if (response.isSuccessful){
	System.out.println("Response"+ response)
}
```

## fetch

The "Get a single organization" call gets the comprehensive details of a specific organization related to the system user.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Organisation organisation = contentstack.organisation();
Call&lt;ResponseBody&gt; response = organisation.fetch().execute();
if (response.isSuccessful){
	System.out.println("Response"+ response)
}
```

## removeParam

Set header for the request.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Organisation organisation = contentstack.organisation();
organisation.removeParam("key");
```

Removes query parameters using the key of the request.

## addHeader

Sets header for the request.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Organisation organisation = contentstack.organisation();
organisation.addHeader("key", value);
```

Header key for the request.

Header value for the request.

## addParam

Sets header for the request.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Organisation organisation = contentstack.organisation();
organisation.addParam("key", value);
```

The query parameter key for the request.

The query parameter value for the request.

## Organization | Java Management SDK | Contentstack

Organization is the top-level entity in Contentstack, letting you manage stacks, resources, and users from one place in the Java Management SDK.