- Source:
Organization is the top-level entity in the hierarchy of Contentstack, consisting of stacks and stack resources, and users. Organization allows easy management of projects as well as users within the Organization. Read more about Organizations..
Methods
(static) fetch(include_plan) → {Promise.<Organization.Organization>}
- Source:
The fetch Organization call fetches Organization details.
Example
import * as contentstack from '@contentstack/management'
const client = contentstack.client()
client.organization('organization_uid').fetch()
.then((organization) => console.log(organization))
Parameters:
Name | Type | Description |
---|---|---|
include_plan |
Int | The include_plan parameter includes the details of the plan that the organization has subscribed to. |
Returns:
Promise for Organization instance
- Type
- Promise.<Organization.Organization>
(static) stacks(limit, skip, asc, desc, include_count, typeahead) → {ContentstackCollection}
- Source:
The Get all stacks in an organization call fetches the list of all stacks in an Organization.
Example
import * as contentstack from '@contentstack/management'
const client = contentstack.client()
client.organization('organization_uid').stacks({ include_count: true })
.then((collection) => console.log(collection))
Parameters:
Name | Type | Description |
---|---|---|
limit |
Int | The limit parameter will return a specific number of stacks in the output. |
skip |
Int | The skip parameter will skip a specific number of stacks in the output. |
asc |
String | When fetching stacks, you can sort them in the ascending order with respect to the value of a specific field in the response body. |
desc |
String | When fetching stacks, you can sort them in the decending order with respect to the value of a specific field in the response body. |
include_count |
Boolean | To retrieve the count of stack. |
typeahead |
String | The type head contains value to be included in search. |
Returns:
Instance of ContentstackCollection.
- Type
- ContentstackCollection
(static) transferOwnership(email) → {Object}
- Source:
The Transfer organization ownership call transfers the ownership of an Organization to another user.
Example
import * as contentstack from '@contentstack/management'
const client = contentstack.client()
client.organization('organization_uid').transferOwnership('emailId')
.then((response) => console.log(response.notice))
Parameters:
Name | Type | Description |
---|---|---|
email |
String | The email address of the user to whom you wish to transfer the ownership of the organization. |
Returns:
Response Object.
- Type
- Object
(static) addUser() → {ContentstackCollection}
- Source:
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.
Example
import * as contentstack from '@contentstack/management'
const client = contentstack.client()
client.organization('organization_uid').addUser({ users: { 'abc@test.com': ['org_uid1', 'org_uid2' ]}, stacks: { 'abc@test.com': { 'api_key1': [ 'stack_role_id' ] } } })
.then((response) => console.log(response))
Returns:
ContentstackCollection of instance.
- Type
- ContentstackCollection
(static) getInvitations() → {String}
- Source:
The Get all organization invitations call gives you a list of all the Organization invitations.
Example
import * as contentstack from '@contentstack/management'
const client = contentstack.client()
client.organization('organization_uid').getInvitations()
.then((response) => console.log(response.notice))
Returns:
Success message of invitation send.
- Type
- String
(static) resendInvitition() → {Object}
- Source:
The Resend pending organization invitation call allows you to resend Organization invitations to users who have not yet accepted the earlier invitation.
Example
import * as contentstack from '@contentstack/management'
const client = contentstack.client()
client.organization('organization_uid').resendInvitition('invitation_uid')
.then((response) => console.log(response.notice))
Returns:
Response Object.
- Type
- Object
(static) roles(limit, skip, asc, desc, include_count, include_stack_roles) → {Array.<Role>}
- Source:
A role is a collection of permissions that will be applicable to all the users who are assigned this role.
Example
import * as contentstack from '@contentstack/management'
const client = contentstack.client()
client.organization('organization_uid').roles()
.then((roles) => console.log(roles))
Parameters:
Name | Type | Description |
---|---|---|
limit |
Int | The limit parameter will return a specific number of roles in the output. |
skip |
Int | The skip parameter will skip a specific number of roles in the output. |
asc |
String | When fetching roles, you can sort them in the ascending order with respect to the value of a specific field in the response body. |
desc |
String | When fetching roles, you can sort them in the decending order with respect to the value of a specific field in the response body. |
include_count |
Boolean | To retrieve the count of roles. |
include_stack_roles |
Boolean | The Include stack roles will return stack details in roles. |
Returns:
Array of Role instance
- Type
- Array.<Role>
(static) fetchAll(limit, skip, asc, desc, include_count, typeahead) → {ContentstackCollection}
- Source:
The Get all organizations call lists all organizations related to the system user in the order that they were created.
Example
import * as contentstack from '@contentstack/management'
const client = contentstack.client()
client.organization().fetchAll()
.then((collection) => console.log(collection))
Parameters:
Name | Type | Description |
---|---|---|
limit |
Int | TThe ‘limit’ parameter will return a specific number of organizations in the output. |
skip |
Int | The ‘skip’ parameter will skip a specific number of organizations in the output. |
asc |
String | The ‘asc’ parameter allows you to sort the list of organizations in the ascending order with respect to the value of a specific field. |
desc |
String | The ‘desc’ parameter allows you to sort the list of Organizations in the descending order with respect to the value of a specific field. |
include_count |
Boolean | The ‘include_count’ parameter returns the total number of organizations related to the user. |
typeahead |
String | The typeahead parameter is a type of filter that allows you to perform a name-based search on all organizations based on the value provided. |
Returns:
Result collection of content of specified module.
- Type
- ContentstackCollection