Managing organization identifiers & metadata
Learn how to use external IDs and metadata to manage and track organizations in Scalekit, associating your own identifiers and storing custom key-value pairs.
Applications often need to manage and track resources in their own systems. Scalekit provides two features to help with this:
- External IDs: Associate your own identifiers with organizations
- Metadata: Store custom key-value pairs with organizations
When to use external IDs and metadata
Section titled “When to use external IDs and metadata”Use these features when you need to:
- Track organizations using your own identifiers instead of Scalekit’s IDs
- Store additional information about organizations like billing details or internal codes
- Integrate Scalekit organizations with your existing systems
Add an external ID to an organization
Section titled “Add an external ID to an organization”External IDs let you identify organizations using your own identifiers. You can set an external ID when creating or updating an organization.
Create a new organization with an external ID
Section titled “Create a new organization with an external ID”This example shows how to create an organization with your custom identifier:
curl https://<SCALEKIT_ENVIRONMENT_URL>/api/v1/organizations \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "display_name": "Megasoft Inc", "external_id": "CUST-12345-MGSFT",}'Update an existing organization’s external ID
Section titled “Update an existing organization’s external ID”To change an organization’s external ID, use the update endpoint:
curl 'https://<SCALEKIT_ENVIRONMENT_URL>/api/v1/organizations/{id}' \ --request PATCH \ --header 'Content-Type: application/json' \ --data '{ "display_name": "Megasoft Inc", "external_id": "TENANT-12345-MGSFT",}'Add metadata to an organization
Section titled “Add metadata to an organization”Metadata lets you store custom information as key-value pairs. You can add metadata when creating or updating an organization.
Create a new organization with metadata
Section titled “Create a new organization with metadata”This example shows how to store billing information with a new organization:
curl https://<SCALEKIT_ENVIRONMENT_URL>/api/v1/organizations \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "display_name": "Megasoft Inc", "metadata": { "invoice_email": "invoices@megasoft.com" }}'Update an existing organization’s metadata
Section titled “Update an existing organization’s metadata”To modify an organization’s metadata, use the update endpoint:
curl 'https://<SCALEKIT_ENVIRONMENT_URL>/api/v1/organizations/{id}' \ --request PATCH \ --header 'Content-Type: application/json' \ --data '{ "display_name": "Megasoft Inc", "metadata": { "invoice_email": "billing@megasoft.com" }}'View external IDs and metadata
Section titled “View external IDs and metadata”All organization endpoints that return organization details will include the external ID and metadata in their responses. This makes it easy to access your custom data when working with organizations.
External ID constraints
Section titled “External ID constraints”External IDs have the following constraints:
- Unique per environment: Each external ID must be unique across all organizations in the same Scalekit environment, regardless of region.
- Maximum length: 255 characters.
- Searchable by
external_id: You can look up organizations byexternal_idusing thelist organizationsendpoint. You cannot search organizations by a metadata field.
Multi-region external ID pattern
Section titled “Multi-region external ID pattern”If your application operates across multiple regions and your internal account IDs are unique only within a region, prefix each external ID with the region name to ensure uniqueness across your Scalekit environment:
us-east-CUST-12345 # US East accounteu-west-CUST-12345 # EU West account with the same internal IDThis pattern keeps the region and account identifier in a single field and stays within the 255-character limit.
Organization deletion and SCIM
Section titled “Organization deletion and SCIM”When you delete an organization in Scalekit, Scalekit automatically deletes all associated connections and SCIM configurations. No charges apply after deletion.
However, if your customer’s identity provider has SCIM provisioning enabled, the IdP will continue attempting to send SCIM events after the organization is deleted. Because there is no active SCIM endpoint to receive those events, the IdP will log errors for each attempt.