Organization

View as Markdown

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.

NameTypeDescription
param.include_plannumber

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.

NameTypeDescription
param.limitnumber

The ‘limit’ parameter will return a specific number of organizations in the output.

param.skipnumber

The ‘skip’ parameter will skip a specific number of organizations in the output.

param.ascstring

The ‘asc’ parameter allows you to sort the list of organizations in the ascending order with respect to the value of a specific field.

descstring

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_countboolean

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.

NameTypeDescription
param.usersobject

List of users to add with roles.

params.stacksobject

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.

NameTypeDescription
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.

NameTypeDescription
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

A role is a collection of permissions that will be applicable to all the users who are assigned this role.
NameTypeDescription
param.limitnumber

The ‘limit’ parameter will return a specific number of organizations in the output.

param.skipnumber

The ‘skip’ parameter will skip a specific number of organizations in the output.

param.ascstring

The ‘asc’ parameter allows you to sort the list of organizations in the ascending order with respect to the value of a specific field.

descstring

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_countboolean

The ‘include_count’ parameter returns the total number of organizations related to the user.

include_stack_rolesboolean

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.

NameTypeDescription
param.limitnumber

The ‘limit’ parameter will return a specific number of organizations in the output.

param.skipnumber

The ‘skip’ parameter will skip a specific number of organizations in the output.

param.ascstring

The ‘asc’ parameter allows you to sort the list of organizations in the ascending order with respect to the value of a specific field.

descstring

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_countboolean

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.

NameTypeDescription
uidstring

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) => {


})