Organizations
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.
Get all Organizations
https://api.contentstack.io/organizations?limit={limit_value}&skip={skip_value}&asc={field_uid}&desc={field_uid}&include_count={boolean_value}&typeahead={value_to_be_searched}The Get all organizations call lists all organizations related to the system user in the order that they were created.
{
"organizations":[
{
"uid":"blt6a6f6666ab666aa6",
"name":"Sample",
"plan_id":"cms_plan",
"owner_uid":"blt1f1cddeaefbefdd111b11111",
"expires_on":"2029-12-31T00:00:00.000Z",
"enabled":true,
"is_over_usage_allowed":true,
"created_at":"2016-05-31T06:30:40.993Z",
"updated_at":"2019-05-24T10:26:41.861Z",
"settings":{
"sso":{
"id":"sample-sso",
"strict":true,
"session_timeout":12,
"sso_roles":{
"enabled":false
},
"saml":{
"acs_url":"https://app.contentstack.com/api/sso/saml2/sample-sso",
"entity_id":"https://app.contentstack.com",
"version":2,
"name_id_format":"Email Address",
"attributes":[
"email",
"first_name",
"last_name"
]
}
}
}
},
{
"uid":"blt4444c44ea4ddf444",
"name":"Sample2",
"plan_id":"testing",
"owner_uid":"blt22e22222d22d2f22222a2b2f",
"is_transfer_set":false,
"expires_on":"2020-01-31T00:00:00.000Z",
"enabled":true,
"is_over_usage_allowed":true,
"created_at":"2016-09-30T05:08:10.076Z",
"updated_at":"2019-04-18T08:45:57.936Z",
"settings":{
"sso":{
"sso_roles":{
"enabled":false
}
}
},
"owner":true
}
]
}Get a single Organization
https://api.contentstack.io/organizations/{organization_uid}?include_plan={boolean_value}The Get a single organization call gets the comprehensive details of a specific organization related to the system user.
{
"organizations": [{
"uid": "blt4444c44ea4ddf444",
"name": "Sample2",
"plan_id": "testing",
"owner_uid": "blt22e22222d22d2f22222a2b2f",
"is_transfer_set": false,
"expires_on": "2020-01-31T00:00:00.000Z",
"enabled": true,
"is_over_usage_allowed": true,
"created_at": "2016-09-30T05:08:10.076Z",
"updated_at": "2019-04-18T08:45:57.936Z",
"settings": {
"sso": {
"sso_roles": {
"enabled": false
}
}
},
"plan": {
"plan_id": "testing",
"name": "Testing",
"message": "",
"price": "$0",
"features": [{
"uid": "users",
"name": "Users",
"limit": 1000,
"enabled": true
},
{
"uid": "stacks",
"name": "Stacks",
"limit": 10000000,
"enabled": true
},
{
"uid": "content_types",
"name": "Content Types",
"limit": 10000000,
"enabled": true
},
{
"uid": "assets",
"name": "Assets",
"limit": 10000000,
"enabled": true
},
{
"uid": "entries",
"name": "Entries",
"limit": 10000000,
"enabled": true
},
{
"uid": "environments",
"name": "Environments",
"limit": 40000000,
"enabled": true
},
{
"uid": "getLimit",
"name": "GET Requests Limit",
"limit": 100,
"enabled": true
},
{
"uid": "limit",
"name": "API Requests Limit",
"limit": 100,
"enabled": true
},
{
"uid": "bulkLimit",
"name": "Bulk Requests Limit",
"limit": 15,
"enabled": true
},
{
"uid": "sso",
"name": "SSO",
"limit": 1,
"enabled": true
},
{
"uid": "workflow",
"name": "Workflow",
"limit": 10,
"enabled": true
},
{
"uid": "globalSearch",
"name": "globalSearch",
"limit": 1,
"enabled": true
},
{
"uid": "extension",
"name": "extension",
"limit": 1,
"enabled": true
},
{
"uid": "extension_widget",
"name": "Custom Widgets",
"limit": 1,
"enabled": true
},
{
"uid": "maxExtensionScopeCtRef",
"name": "Scope of CT for custom widgets",
"limit": 23,
"enabled": true
},
{
"uid": "workflow_old_api",
"name": "workflow_old_api",
"limit": 20,
"enabled": true
},
{
"uid": "bulk-action",
"name": "Bulk Action",
"limit": 25,
"enabled": true
},
{
"uid": "ssoEntityId",
"name": "SSO Entity ID",
"limit": 1,
"enabled": true
},
{
"uid": "graphql",
"name": "GraphQL",
"limit": 100,
"enabled": true
},
{
"uid": "graphqlLimit",
"name": "GraphQL Limit",
"limit": 1,
"enabled": true
},
{
"uid": "deliveryTokens",
"name": "Delivery Tokens",
"limit": 3,
"enabled": true
},
{
"uid": "ssoRoles",
"name": "SSO Roles",
"limit": 1,
"enabled": true
},
{
"uid": "dashboard_widget",
"name": "Dashboard Widget",
"limit": 1,
"enabled": true
},
{
"uid": "total_extensions",
"name": "Total Extensions",
"limit": 50,
"enabled": true
},
{
"uid": "analyticsDashboard",
"name": "Analytics Dashboard",
"limit": 1,
"enabled": true
},
{
"uid": "maxDynamicBlocksPerContentType",
"name": "maxDynamicBlocksPerContentType",
"limit": 20,
"enabled": true
},
{
"uid": "maxDynamicBlockDefinations",
"name": "maxDynamicBlockDefinations",
"limit": 20,
"enabled": true
},
{
"uid": "maxDynamicBlockObjects",
"name": "maxDynamicBlockObjects",
"limit": 20,
"enabled": true
},
{
"uid": "dashboard",
"name": "Dashboard",
"enabled": true,
"limit": 1
},
{
"uid": "languageFallback",
"name": "Fallback Language",
"enabled": true,
"limit": 1
},
{
"uid": "fieldLevelLocalization",
"name": "fieldLevelLocalization",
"limit": 1,
"enabled": true
},
{
"uid": "stackCreationLimit",
"name": "Stack Creation Limit",
"enabled": true,
"limit": 10
},
{
"uid": "inProgressEntries",
"name": "In-Progress Entries",
"enabled": true,
"limit": 1
},
{
"uid": "publishLocalizedVersions",
"name": "publishLocalizedVersions",
"limit": 50,
"enabled": false
}
],
"created_at": "2017-12-15T12:18:34.602Z",
"updated_at": "2019-07-11T12:52:44.965Z"
},
"owner": true
}]
}Get all roles in an Organization
https://api.contentstack.io/organizations/{organization_uid}/roles?limit={limit_value}&skip={skip_value}&asc={field_uid}&desc={field_uid}&include_count={boolean_value}&include_stack_roles={boolean_value}The Get all roles in an organization call gives the details of all the roles that are set to users in an Organization.
When executing the API call, provide the Organization's UID.
{
"roles": [{
"uid": "blt888bdcb888fefc88d8888e8a",
"name": "Admin",
"description": "Admin Role",
"org_uid": "blt6eb666a6feb6666b6b6e666e",
"admin": true,
"default": true,
"users": [
"blt33dd3fd33333333e33f3aa33",
"bltf44c4ca4f444e444",
"blt55bcad5ae5cc5b5d"
],
"created_at": "2017-09-17T11:50:52.557Z",
"update_at": "2017-09-17T11:50:52.557Z"
},
{
"uid": "blt084e2101471d9d2a27a5abb4",
"name": "Member",
"description": "Member Role",
"org_uid": "blt6eb149a1feb2263b6b6e454e",
"default": true,
"users": [
"blt11dd3fd11111111e11f1aa11",
"bltf22c2ca2f2222e222",
"blt22bcad2ae2cc2b2d"
],
"created_at": "2017-09-17T11:50:52.190Z",
"update_at": "2017-09-17T11:50:52.190Z"
}
]
}Get Organization users by email
https://api.contentstack.io/organizations/{organization_uid}/share/searchThe Get Organization users by email request retrieves information about users within an organization based on their email addresses.
When executing the API request, you need to provide the organization UID. In the request body, you need to enter the email IDs of the users whose details you want to retrieve from the mentioned organization, like as follows:
{
"emails":["[email protected]", "[email protected]", …]
}
Note If you do not pass the request body, you will get the details of all the users in the Organization.
{
"emails":["[email protected]"]
}{
"shares": [
{
"uid": "blt1231231231231231",
"email": "[email protected]",
"user_uid": "blteaf2e44ba211bb3f",
"message": "",
"org_uid": "blt3213213213213213",
"org_roles": [
"blt2132132132132132"
],
"invited_by": "blt1321321321321321",
"invited_at": "2023-10-13T12:17:02.473Z",
"status": "accepted",
"acceptance_token": "blt1112223331231231",
"created_at": "2023-10-13T12:17:02.468Z",
"updated_at": "2023-10-13T12:17:25.670Z"
}
]
}Add users to Organization
https://api.contentstack.io/organizations/{organization_uid}/shareThe Add users to organization request allows you to send invitations to add users to your organization. Only the owner or the admin of the organization can add users.
When executing the API request, in the request body, provide the organization admin/member role ID, obtained from the Get all roles in an Organization request. Also, provide the stack role UID of the user in the request body, obtained from the Get all roles request.
{
"share": {
"users": {
"[email protected]": ["{{orgAdminRoleUid}}"],
"[email protected]": ["{{orgMemberRoleUid}}"]
},
"stacks": {
"[email protected]": {
"{{apiKey}}": ["{{stackRoleUid1}}"]
},
"[email protected]": {
"blta1ed1f11111c1eb1": ["blt111d1b110111e1f1"],
"bltf0c00caa0f0000f0": ["bltcea22222d2222222", "blt333f33cb3e33ffde"]
}
},
"message": "Invitation message"
}
}{
"notice": "The invitation has been sent successfully.",
"shares": [{
"uid": "bltdad32690d8ac4698f4a9fc24",
"email": "[email protected]",
"user_uid": "blt65a26b0aae48wexft43463",
"message": "Test Message",
"org_uid": "bltad182661f48a9afe1d00cdc2",
"org_roles": [
"blt18d4b92df0b3b432975188a7"
],
"invited_by": "bltf9252892ba54cfc0811eb745",
"invited_at": "2017-09-17T19:46:48.987Z",
"status": "pending",
"created_at": "2017-09-17T19:46:48.981Z",
"update_at": "2017-09-17T19:46:48.981Z"
},
{
"uid": "bltcbccc241b3a4da1c352f8cec",
"email": "[email protected]",
"user_uid": "blt65a26b0aae48223c7ead5c30",
"message": "Test Message",
"org_uid": "bltad182661f48a9afe1d00cdc2",
"org_roles": [
"blt3733b2ca83073f4c71a41caf"
],
"invited_by": "bltf9252892ba54cfc0811eb745",
"invited_at": "2017-09-17T19:46:48.990Z",
"status": "accepted",
"created_at": "2017-09-17T19:46:48.982Z",
"update_at": "2017-09-17T19:46:48.982Z"
},
{
"uid": "bltb01c45c6c8e9326b6ba94caf",
"email": "[email protected]",
"message": "Test Message",
"org_uid": "bltad182661f48a9afe1d00cdc2",
"org_roles": [
"blt3733b2ca83073f4c71a41caf"
],
"invited_by": "bltf9252892ba54cfc0811eb745",
"invited_at": "2017-09-17T19:46:48.992Z",
"status": "pending",
"created_at": "2017-09-17T19:46:48.983Z",
"update_at": "2017-09-17T19:46:48.983Z"
}
]
}Remove users from organization
https://api.contentstack.io/organizations/{organization_uid}/shareThe Remove users from organization request allows you to remove existing users from your organization.
NoteOnly the owner or the admin of the organization can remove users.
When executing the API request, provide the organization UID. In the “Body” section, you need to enter the email IDs of the users you want to remove from the organization as follows:
{
"emails":[
"[email protected]", "[email protected]"
]
}{
"emails":[
"[email protected]", "[email protected]"
]
}{
"notice":"The invitation has been deleted successfully.",
"shares":[
{
"uid":"bltdad32690d8ac4698f4afc1",
"email":"[email protected]",
"user_uid":"blt65a26b0aae48wexft43",
"org_uid":"bltad661f48a9afe1d00cd2",
"org_roles":[
"blt18d4b92df0b3b432975188a7"
],
"invited_by":"bltf922a54cfc0811eb7",
"invited_at":"2017-09-17T19:46:48.987Z",
"status":"pending",
"created_at":"2019-03-12T05:21:40.015Z",
"updated_at":"2019-03-12T05:21:40.015Z",
"access_without_sso":true
},
{
"uid":"bltcbc41b34a1c352f8ce",
"email":"[email protected]",
"user_uid":"blt65a26b0aae482c7d5c3",
"message":"Test Message",
"org_uid":"bltad161f48a9afe1d00cd2",
"org_roles":[
"blt3733b2ca83073f4c71a4ca"
],
"invited_by":"blte75599b1e529fa3a",
"invited_at":"2020-03-06T06:29:13.510Z",
"status":"pending",
"created_at":"2020-03-06T06:29:13.510Z",
"updated_at":"2020-03-06T06:29:13.510Z"
}
]
}Resend pending Organization invitation
https://api.contentstack.io/organizations/{organization_uid}/share/{share_uid}/resend_invitationThe Resend pending organization invitation request allows you to resend the 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.
When executing Get all organization invitations request, you get the invitation status that helps to identify the pending invitations and share UID. When executing the Resend pending organization invitation API request, provide the Organization UID and share UID.
{
"notice": "The invitation has been resent successfully."
}Get all Organization invitations
https://api.contentstack.io/organizations/{organization_uid}/share?limit={limit_value}&skip={skip_value}&asc={field_uid}&desc={field_uid}&include_count={boolean_value}&include_roles={boolean_value}&include_invited_by={boolean_value}&include_user_details={boolean_value}&typeahead={value}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.
{
"shares": [
{
"uid": "bltcbccc241b3a4da1c352f8cec",
"email": "[email protected]",
"user_uid": "blt65a26b0aae48223c7ead5c30",
"message": "Test Message",
"org_uid": "bltad182661f48a9afe1d00cdc2",
"org_roles": [
"blt3733b2ca83073f4c71a41caf"
],
"invited_by": "bltf9252892ba54cfc0811eb745",
"invited_at": "2017-09-17T19:46:48.990Z",
"status": "accepted",
"created_at": "2017-09-17T19:46:48.982Z",
"update_at": "2017-09-17T19:46:48.982Z"
},
{
"uid": "bltb01c45c6c8e9326b6ba94caf",
"email": "[email protected]",
"user_uid": "blt3a17bcc7c0ec0930caedccf2",
"message": "Test Message",
"org_uid": "bltad182661f48a9afe1d00cdc2",
"org_roles": [
"blt3733b2ca83073f4c71a41caf"
],
"invited_by": "bltf9252892ba54cfc0811eb745",
"invited_at": "2017-09-17T19:46:48.992Z",
"status": "pending",
"created_at": "2017-09-17T19:46:48.983Z",
"update_at": "2017-09-17T20:24:22.440Z"
}
],
"count": 3
}Transfer Organization ownership
https://api.contentstack.io/organizations/{organization_uid}/transfer-ownershipThe 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.
Once the specified user accepts the invitation by clicking on the link provided in the email, the ownership of the Organization gets transferred to the new user. Subsequently, the previous owner will no longer have any permission on the Organization.
When executing the API call, provide the Organization UID.
{
"transfer_to": "[email protected]"
}{
"notice": "Email has been successfully sent to the user."
}Get all stacks in an Organization
https://api.contentstack.io/organizations/{organization_uid}/stacks?limit={limit_value}&skip={skip_value}&asc={field_uid}&desc={field_uid}&include_count={boolean_value}&typeahead={value_to_be_searched}The Get all stacks in an organization call fetches the list of all stacks in an Organization.
When executing the API call, provide the Organization UID.
{
"stacks": [{
"created_at": "2017-09-28T06:09:19.912Z",
"updated_at": "2017-09-29T07:29:00.879Z",
"uid": "blt046702aa419c8f9d",
"name": "testv3-B",
"api_key": "blt01a49e20d89b197e",
"owner_uid": "blt02f4a95744f5301e",
"owner": {
"email": "[email protected]",
"first_name": "Aravind",
"last_name": "Kumar"
},
"users": {
"count": 5
}
}],
"count": 4
}Get organization log details
https://api.contentstack.io/organizations/{organization_uid}/logsThe Get organization log details request is used to retrieve the audit log details of an organization.
You can apply queries to filter the results. Refer to the Queries section for more details.
When executing the API call, provide the Organization UID.
TipThis 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 a paginated form.
{
"logs": [{
"uid": "blt8a6de4d89d4dcffbd1b6",
"org_uid": "blt3cbc7416a3d8a026",
"created_at": "ISODate(2018 - 02 - 13 T12: 41: 24.625 Z)",
"created_by": "bltdd494873d2e0fee7",
"module": "user",
"event_type": "share",
"metadata": {
"uid": "blt3cbc7416a3d8a026"
},
"remote_addr": "54.174.130.249",
"request": {
"share": {
"users": [{
"email": "[email protected]",
"org_roles": ["bltbd1cb8a0838069de"]
}],
"stacks": []
}
},
"response": {
"notice": "The invitation has been sent successfully.",
"shares": [{
"uid": "blt567a680139f45088",
"email": "[email protected]",
"user_uid": null,
"message": null,
"org_uid": "blt3cbc7416a3d8a026",
"org_roles": ["bltbd1cb8a0838069de"],
"invited_by": "bltdd494873d2e0fee7",
"invited_at": "ISODate(2018 - 02 - 13 T12:41: 24.617 Z)",
"status": "pending",
"created_at": "ISODate(2018-02-13 T12:41:24.615Z)",
"updated_at": "ISODate(2018-02-13 T12:41:24.615Z)"
}]
}
},
{
"uid": "blt5839ff8426cb98d7eddc",
"org_uid": "blt84dad57ea71e7cbe",
"created_at": "ISODate(2019-03-06T07:00:47.029Z)",
"created_by": "bltd3bb71a3e7cfbf16",
"module": "user",
"event_type": "logout",
"metadata": {
"uid": "bltd3bb71a3e7cfbf16",
"logout_at": "ISODate(2019-03-06T07:00:47.029Z)"
},
"remote_addr": "::ffff:127.0.0.1",
"request": {},
"response": {
"notice": "systemUser.success.logout"
}
}
]
}Get organization log item
https://api.contentstack.io/organizations/{organization_uid}/logs/{log_uid}The Get organization log item request is used to retrieve a specific item from the audit log of an organization.
When executing the Get organization log details request, you get the Organization UID and Log UID. Use these values to execute the Get organization log item API request.
{
"log": {
"uid": "blt8a6de4d89d4dcffbd1b6",
"org_uid": "blt3cbc7416a3d8a026",
"created_at": "ISODate(2018-02-13T12:41:24.625Z)",
"created_by": "bltdd494873d2e0fee7",
"module": "user",
"event_type": "share",
"metadata": {
"uid": "blt3cbc7416a3d8a026"
},
"remote_addr": "54.174.130.249",
"request": {
"share": {
"users": [{
"email": "[email protected]",
"org_roles": ["bltbd1cb8a0838069de"]
}],
"stacks": []
}
},
"response": {
"notice": "The invitation has been sent successfully.",
"shares": [{
"uid": "blt567a680139f45088",
"email": "[email protected]",
"user_uid": null,
"message": null,
"org_uid": "blt3cbc7416a3d8a026",
"org_roles": ["bltbd1cb8a0838069de"],
"invited_by": "bltdd494873d2e0fee7",
"invited_at": "ISODate(2018-02-13T12:41:24.617Z)",
"status": "pending",
"created_at": "ISODate(2018-02-13T12:41:24.615Z)",
"updated_at": "ISODate(2018-02-13T12:41:24.615Z)"
}]
}
}
}