Organizations

edit

List organizations

edit

Fetch organizations available to the current user. Currently unavailable in self-hosted ECE.

Request

edit

GET /api/v1/organizations

Responses

edit
200

(OrganizationList)

Organizations fetched successfully

401

(BasicFailedReply)

User not found. (code: user.not_found)

Headers

x-cloud-error-codes (string; allowed values: [user.not_found])
The error codes associated with the response

Request example

edit
curl -XGET https://api.elastic-cloud.com/api/v1/organizations \
-H "Authorization: ApiKey $EC_API_KEY"

Get organization invitation

edit

Gets a single invitation to an organization by token. Currently unavailable in self-hosted ECE.

Request

edit

GET /api/v1/organizations/invitations/{invitation_token}

Path parameters

edit
Name Type Required Description

invitation_token

string

Y

Organization invitation token

Responses

edit
200

(OrganizationInvitation)

Organization invitation fetched successfully

404

(BasicFailedReply)

Invitation not found. (code: organization.invitation_not_found)

Headers

x-cloud-error-codes (string; allowed values: [organization.invitation_not_found])
The error codes associated with the response

Request example

edit
curl -XGET https://api.elastic-cloud.com/api/v1/organizations/invitations/{invitation_token} \
-H "Authorization: ApiKey $EC_API_KEY"

Accept an organization invitation

edit

Accepts an organization invitation. Currently unavailable in self-hosted ECE.

Request

edit

POST /api/v1/organizations/invitations/{invitation_token}/_accept

Path parameters

edit
Name Type Required Description

invitation_token

string

Y

Organization invitation token

Responses

edit
200

(EmptyResponse)

Organization invitation accepted successfully

400

(BasicFailedReply)

User already belongs to organization. (code: organization.user_organization_already_belongs)

Headers

x-cloud-error-codes (string; allowed values: [organization.user_organization_already_belongs])
The error codes associated with the response
403

(BasicFailedReply)

The current user authentication is not valid. (code: root.invalid_authentication)

Headers

x-cloud-error-codes (string; allowed values: [root.invalid_authentication])
The error codes associated with the response
404

(BasicFailedReply)

  • Organization not found. (code: organization.not_found)
  • User not found. (code: user.not_found)
  • Invitation not found. (code: organization.invitation_not_found)

Headers

x-cloud-error-codes (string; allowed values: [organization.not_found, user.not_found, organization.invitation_not_found])
The error codes associated with the response

Request example

edit
curl -XPOST https://api.elastic-cloud.com/api/v1/organizations/invitations/{invitation_token}/_accept \
-H "Authorization: ApiKey $EC_API_KEY"

Fetch organization information

edit

Fetch a single organization by id. Currently unavailable in self-hosted ECE.

Request

edit

GET /api/v1/organizations/{organization_id}

Path parameters

edit
Name Type Required Description

organization_id

string

Y

Identifier for the Organization

Responses

edit
200

(Organization)

Organization fetched successfully

401

(BasicFailedReply)

User not found. (code: user.not_found)

Headers

x-cloud-error-codes (string; allowed values: [user.not_found])
The error codes associated with the response
403

(BasicFailedReply)

The current user does not have access to the requested organization. (code: organization.invalid_access)

Headers

x-cloud-error-codes (string; allowed values: [organization.invalid_access])
The error codes associated with the response
404

(BasicFailedReply)

Organization not found. (code: organization.not_found)

Headers

x-cloud-error-codes (string; allowed values: [organization.not_found])
The error codes associated with the response

Request example

edit
curl -XGET https://api.elastic-cloud.com/api/v1/organizations/{organization_id} \
-H "Authorization: ApiKey $EC_API_KEY"

Update organization

edit

This endpoint is deprecated and scheduled to be removed in the next major version.

Updates an existing organization. Currently unavailable in self-hosted ECE.

Request

edit

PUT /api/v1/organizations/{organization_id}

Path parameters

edit
Name Type Required Description

organization_id

string

Y

Identifier for the Organization

Request body

edit

(OrganizationRequest) (required) The organization to update

Responses

edit
200

(Organization)

Organization updated successfully

400

(BasicFailedReply)

  • Name must be between 2 and 30 characters. (code: organization.invalid_name)
  • User already has an organization. (code: organization.user_organization_already_exists)

Headers

x-cloud-error-codes (string; allowed values: [organization.invalid_name, organization.user_organization_already_exists])
The error codes associated with the response
401

(BasicFailedReply)

You are not authorized to perform this action

403

(BasicFailedReply)

The current user does not have access to the requested organization. (code: organization.invalid_access)

Headers

x-cloud-error-codes (string; allowed values: [organization.invalid_access])
The error codes associated with the response
404

(BasicFailedReply)

Organization not found. (code: organization.not_found)

Headers

x-cloud-error-codes (string; allowed values: [organization.not_found])
The error codes associated with the response

Request example

edit
curl -XPUT https://api.elastic-cloud.com/api/v1/organizations/{organization_id} \
-H "Authorization: ApiKey $EC_API_KEY" \
-H 'Content-Type: application/json' \
-d '
{
   "billing_contacts" : [
      "string"
   ],
   "default_disk_usage_alerts_enabled" : true,
   "name" : "string",
   "notifications_allowed_email_domains" : [
      "string"
   ],
   "operational_contacts" : [
      "string"
   ]
}
'

List organization invitations

edit

Fetch open invitations to the selected organization. Currently unavailable in self-hosted ECE.

Request

edit

GET /api/v1/organizations/{organization_id}/invitations

Path parameters

edit
Name Type Required Description

organization_id

string

Y

Identifier for the Organization

Responses

edit
200

(OrganizationInvitations)

Organization invitations fetched successfully

404

(BasicFailedReply)

Organization not found. (code: organization.not_found)

Headers

x-cloud-error-codes (string; allowed values: [organization.not_found])
The error codes associated with the response

Request example

edit
curl -XGET https://api.elastic-cloud.com/api/v1/organizations/{organization_id}/invitations \
-H "Authorization: ApiKey $EC_API_KEY"

Create organization invitations

edit

Creates or refreshes organization invitations. Currently unavailable in self-hosted ECE.

Request

edit

POST /api/v1/organizations/{organization_id}/invitations

Path parameters

edit
Name Type Required Description

organization_id

string

Y

Identifier for the Organization

Request body

edit

(OrganizationInvitationRequest) (required) The organization invitations to create or refresh

Responses

edit
201

(OrganizationInvitations)

Organization invitations created successfully

400

(BasicFailedReply)

  • Invitation email was not valid. (code: organization.invitation_invalid_email)
  • Invitation already sent. (code: organization.invitation_already_exists)
  • User already belongs to organization. (code: organization.user_organization_already_belongs)

Headers

x-cloud-error-codes (string; allowed values: [organization.invitation_invalid_email, organization.invitation_already_exists, organization.user_organization_already_belongs])
The error codes associated with the response
403

(BasicFailedReply)

The current user authentication is not valid. (code: root.invalid_authentication)

Headers

x-cloud-error-codes (string; allowed values: [root.invalid_authentication])
The error codes associated with the response
404

(BasicFailedReply)

  • Organization not found. (code: organization.not_found)
  • User not found. (code: user.not_found)
  • Invitation sender does not belong to organization. (code: organization.user_organization_does_not_belong)

Headers

x-cloud-error-codes (string; allowed values: [organization.not_found, user.not_found, organization.user_organization_does_not_belong])
The error codes associated with the response
429

(BasicFailedReply)

Request exceeds organization invitation creation rate limits. (code: organization.invitations_rate_limit_exceeded)

Headers

x-cloud-error-codes (string; allowed values: [organization.invitations_rate_limit_exceeded])
The error codes associated with the response

Request example

edit
curl -XPOST https://api.elastic-cloud.com/api/v1/organizations/{organization_id}/invitations \
-H "Authorization: ApiKey $EC_API_KEY" \
-H 'Content-Type: application/json' \
-d '
{
   "emails" : [
      "string"
   ],
   "expires_in" : "string",
   "role_assignments" : {
      "deployment" : [
         {
            "all" : true,
            "application_roles" : [
               "string"
            ],
            "deployment_ids" : [
               "string"
            ],
            "organization_id" : "string",
            "role_id" : "string"
         }
      ],
      "organization" : [
         {
            "organization_id" : "string",
            "role_id" : "string"
         }
      ],
      "platform" : [
         {
            "role_id" : "string"
         }
      ],
      "project" : {
         "elasticsearch" : [
            {
               "all" : true,
               "application_roles" : [
                  "string"
               ],
               "organization_id" : "string",
               "project_ids" : [
                  "string"
               ],
               "role_id" : "string"
            }
         ],
         "observability" : [
            {
               "all" : true,
               "application_roles" : [
                  "string"
               ],
               "organization_id" : "string",
               "project_ids" : [
                  "string"
               ],
               "role_id" : "string"
            }
         ],
         "security" : [
            {
               "all" : true,
               "application_roles" : [
                  "string"
               ],
               "organization_id" : "string",
               "project_ids" : [
                  "string"
               ],
               "role_id" : "string"
            }
         ]
      }
   }
}
'

Delete organization invitations

edit

Deletes one or more organization invitations. Currently unavailable in self-hosted ECE.

Request

edit

DELETE /api/v1/organizations/{organization_id}/invitations/{invitation_tokens}

Path parameters

edit
Name Type Required Description

invitation_tokens

string

Y

CSV list of Invitation tokens

organization_id

string

Y

Identifier for the Organization

Responses

edit
200

(EmptyResponse)

Organization invitations deleted successfully

400

(BasicFailedReply)

No valid invitation token was supplied. (code: root.invalid_data)

Headers

x-cloud-error-codes (string; allowed values: [root.invalid_data])
The error codes associated with the response
404

(BasicFailedReply)

  • Organization not found. (code: organization.not_found)
  • Invitation not found. (code: organization.invitation_not_found)

Headers

x-cloud-error-codes (string; allowed values: [organization.not_found, organization.invitation_not_found])
The error codes associated with the response

Request example

edit
curl -XDELETE https://api.elastic-cloud.com/api/v1/organizations/{organization_id}/invitations/{invitation_tokens} \
-H "Authorization: ApiKey $EC_API_KEY"

List organization members

edit

Fetch users belonging to the selected organization. Currently unavailable in self-hosted ECE.

Request

edit

GET /api/v1/organizations/{organization_id}/members

Path parameters

edit
Name Type Required Description

organization_id

string

Y

Identifier for the Organization

Responses

edit
200

(OrganizationMemberships)

Organization members fetched successfully

404

(BasicFailedReply)

Organization not found. (code: organization.not_found)

Headers

x-cloud-error-codes (string; allowed values: [organization.not_found])
The error codes associated with the response

Request example

edit
curl -XGET https://api.elastic-cloud.com/api/v1/organizations/{organization_id}/members \
-H "Authorization: ApiKey $EC_API_KEY"

Delete organization memberships

edit

Deletes one or more organization memberships. Currently unavailable in self-hosted ECE.

Request

edit

DELETE /api/v1/organizations/{organization_id}/members/{user_ids}

Path parameters

edit
Name Type Required Description

organization_id

string

Y

Identifier for the Organization

user_ids

string

Y

CSV list of User identifiers

Query parameters

edit
Name Type Required Description

force

boolean; default: false

N

Whether or not to force the removal of Org memberships (effective only for Platform Admins)

Responses

edit
200

(EmptyResponse)

Organization membership deleted successfully

404

(BasicFailedReply)

  • User not found. (code: user.not_found)
  • Organization not found. (code: organization.not_found)
  • Organization membership not found. (code: organization.membership_not_found)

Headers

x-cloud-error-codes (string; allowed values: [user.not_found, organization.not_found, organization.membership_not_found])
The error codes associated with the response

Request example

edit
curl -XDELETE https://api.elastic-cloud.com/api/v1/organizations/{organization_id}/members/{user_ids} \
-H "Authorization: ApiKey $EC_API_KEY"