Organization
Organization
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.
fetch
The fetch Organization call fetches Organization details.
| Name | Type | Description |
|---|---|---|
| param.include_plan | number | The include_plan parameter includes the details of the plan that the organization has subscribed to. |
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })
client.organization('organization_uid').fetch()
.then((organization) => console.log(organization))stacks
The Get all stacks in an organization call fetches the list of all stacks in an Organization.
| Name | Type | Description |
|---|---|---|
| param.limit | number | The ‘limit’ parameter will return a specific number of organizations in the output. |
| param.skip | number | The ‘skip’ parameter will skip a specific number of organizations in the output. |
| param.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. |
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })
client.organization('organization_uid').stacks({ include_count: true })
.then((collection) => console.log(collection))addUser
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.
| Name | Type | Description |
|---|---|---|
| param.users | object | List of users to add with roles. |
| params.stacks | object | List of user with stack API key and roles id to be assign from stack. |
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })
client.organization('organization_uid').addUser({ users: { '[email protected]': ['org_uid1', 'org_uid2' ]}, stacks: { '[email protected]': { 'api_key1': [ 'stack_role_id' ] } } })
.then((response) => console.log(response))transferOwnership
The Transfer organization ownership call transfers the ownership of an Organization to another user.
| Name | Type | Description |
|---|---|---|
| email (required) | string | Email id of user to transfer the ownership of the organization. |
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })
client.organization('organization_uid').transferOwnership('email_id')
.then((response) => console.log(response))getInvitations
The Get all organization invitations call gives you a list of all the Organization invitations.
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })
client.organization('organization_uid').getInvitations()
.then((response) => console.log(response))resendInvitition
The Resend pending organization invitation call allows you to resend Organization invitations to users who have not yet accepted the earlier invitation.
| Name | Type | Description |
|---|---|---|
| invitation_uid (required) | string | The invitation id for which request to be sent |
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })
client.organization('organization_uid').resendInvitition('invitation_uid')
.then((response) => console.log(response.notice))roles
| Name | Type | Description |
|---|---|---|
| param.limit | number | The ‘limit’ parameter will return a specific number of organizations in the output. |
| param.skip | number | The ‘skip’ parameter will skip a specific number of organizations in the output. |
| param.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. |
| include_stack_roles | boolean | The Include stack roles will return stack details in roles. |
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })
client.organization('organization_uid').roles()
.then((roles) => console.log(roles))fetchAll
The Get all organizations call lists all organizations related to the system user in the order that they were created.
| Name | Type | Description |
|---|---|---|
| param.limit | number | The ‘limit’ parameter will return a specific number of organizations in the output. |
| param.skip | number | The ‘skip’ parameter will skip a specific number of organizations in the output. |
| param.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. |
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })
client.organization().fetchAll()
.then((collection) => console.log(collection))organization
Organization is the top-level entity in the hierarchy of Contentstack, consisting of stacks and stack resources, and users.
| Name | Type | Description |
|---|---|---|
| uid | string | Organization UID. |
import * as contentstack from '@contentstack/management'
const client = contentstack.client()
client.organization().findAll()
.then((organization) => {
})import * as contentstack from '@contentstack/management'
const client = contentstack.client()
client.organization('org_uid').fetch()
.then((organization) => {
})