Skip to main content

/i/apps/create

Endpoint

/i/apps/create

Overview

Create a new app definition, initialize core app-user indexes, and optionally upload app image.

Authentication

  • API Key (parameter): api_key=YOUR_API_KEY
  • Auth Token (parameter): auth_token=YOUR_AUTH_TOKEN
  • Auth Token (header): countly-token: YOUR_AUTH_TOKEN

Permissions

  • Global admin permission is required.

Request Parameters

ParameterTypeRequiredDescription
api_keyStringYes (or use auth_token)Dashboard API authentication key.
auth_tokenStringYes (or use api_key)Dashboard auth token.
argsJSON String (Object)YesApp creation payload.

args Object Structure

FieldTypeRequiredDescription
nameStringYesApp display name.
countryStringNoISO country code. Falls back to configured default if invalid/missing.
timezoneStringNoIANA timezone. Falls back to configured default if invalid/missing.
categoryStringNoCategory code (1 to 20). Falls back to configured default if invalid/missing.
typeStringNoApp type. Invalid/missing values are normalized to mobile.
keyStringNoApp key. Generated automatically when missing.
checksum_saltStringNoOptional checksum salt used by SDK checksum workflows.

Configuration Impact

SettingDefaultAffectsUser-visible impact
apps.countryServer configInput normalizationInvalid/missing args.country is replaced with this default value.
apps.timezoneServer configInput normalizationInvalid/missing args.timezone is replaced with this default value.
apps.categoryServer configInput normalizationInvalid/missing args.category is replaced with this default value.

Response

Success Response

{
"_id": "64b0ac10c2c3ce0012dd1001",
"name": "My App",
"country": "US",
"timezone": "Etc/UTC",
"category": "6",
"type": "mobile",
"key": "3a4f9d...",
"owner": "64afcc1a4f5f0f0012a11101",
"created_at": 1717600000,
"edited_at": 1717600000,
"seq": 0,
"has_image": false
}

Response Fields

FieldTypeDescription
_idStringNew app ID.
nameStringApp name.
countryStringFinal country value after validation/defaulting.
timezoneStringFinal timezone value after validation/defaulting.
categoryStringFinal category value after validation/defaulting.
typeStringFinal app type.
keyStringApp key (provided or generated).
ownerStringCreator member ID.
created_atNumberCreation timestamp (seconds).
edited_atNumberLast edit timestamp (seconds).
seqNumberInitial app-user sequence counter.
has_imageBooleanApp image availability flag.

Error Responses

Status Code: 400 Bad Request

{
"result": "Error: Validation error details"
}

Status Code: 400 Bad Request

{
"result": "App key already in use"
}

Status Code: 500 Internal Server Error

{
"result": "Error creating App: database error"
}

Behavior/Processing

Behavior Modes

ModeTriggerProcessing PathResponse Shape
Auto-key creationargs.key is missing/emptyGenerates a key, validates uniqueness, inserts app.Raw object response (new app document).
Provided-key creationargs.key is providedValidates key uniqueness, inserts app.Raw object response (new app document).

Impact on Other Data

  • Creates indexes on countly.app_users{appId} for core user analytics/query paths.
  • Dispatches app-create integration hooks so other features can initialize app-scoped data.
  • If app image is uploaded, stores image content in app image storage.

Database Collections

CollectionUsed forData touched by this endpoint
countly.membersAuthentication and owner assignmentReads caller identity and sets owner field on created app.
countly.appsApp definition storageInserts the new app document.
countly.app_users{appId}App-user profile index initializationCreates indexes on the newly created app-user collection namespace.
countly_fsApp image storageStores app image file when image upload is included.

Examples

Example 1: Create app with defaults

/i/apps/create?api_key=YOUR_API_KEY&args={"name":"My App"}

Example 2: Create app with explicit region/timezone

/i/apps/create?api_key=YOUR_API_KEY&args={"name":"My App","country":"US","timezone":"America/New_York","category":"6"}

Limitations

  • Only global admins can create apps through this endpoint.
  • App type must be supported by enabled app-type integrations; invalid values are normalized to mobile.

Last Updated

2026-02-17