Langsung ke konten

Apps

Konten ini belum tersedia dalam bahasa Anda.

Apps are the foundational entities in Capgo. Each app represents a unique Capacitor application that you can manage and update through the platform. The Apps API allows you to create, retrieve, update, and delete app configurations.

Understanding Apps

An app in Capgo represents your Capacitor application and includes:

  • App ID: Unique identifier for your application
  • Name: Human-readable name of your application
  • Icons: Visual identifiers for your app in the dashboard
  • Configuration: Settings that control how updates are delivered
  • Ownership: Organization and user access information
  • Usage Statistics: Metrics about installs and updates

Best Practices

  1. Naming Convention: Use clear, identifiable names for your apps
  2. Security: Protect your API keys and access credentials
  3. Organization: Group related apps under the same organization
  4. Monitoring: Regularly check app statistics and performance
  5. Backup: Maintain configuration backups for critical apps

Endpoints

GET

https://api.capgo.app/app/

Retrieve information about your apps.

Query Parameters

  • page: Optional. Page number for pagination
  • limit: Optional. Number of results per page (default: 50)
  • org_id: Optional. Filter apps by organization ID. If not provided, returns apps from all organizations the user has access to

For getting a specific app:

  • Use the app ID in the URL path: https://api.capgo.app/app/:id

Response Type

interface App {
app_id: string
created_at: string | null
default_upload_channel: string
icon_url: string
id: string | null
last_version: string | null
name: string | null
owner_org: string
retention: number
transfer_history: Json[] | null
updated_at: string | null
user_id: string | null
}

Example Request

Terminal window
# Get all apps
curl -H "authorization: your-api-key" \
"https://api.capgo.app/app/"
# Get apps from a specific organization
curl -H "authorization: your-api-key" \
"https://api.capgo.app/app/?org_id=org_123"
# Get specific app
curl -H "authorization: your-api-key" \
"https://api.capgo.app/app/app_123"

Example Response

{
"data": [
{
"app_id": "app_123",
"created_at": "2024-01-01T00:00:00Z",
"default_upload_channel": "dev",
"icon_url": "https://example.com/icon.png",
"id": "550e8400-e29b-41d4-a716-446655440000",
"last_version": "1.0.0",
"name": "My Awesome App",
"owner_org": "org_123",
"retention": 2592000,
"transfer_history": null,
"updated_at": "2024-01-01T00:00:00Z",
"user_id": "user_123"
}
]
}

POST

https://api.capgo.app/app/

Create a new app.

Request Body

interface CreateApp {
name: string
icon?: string
owner_org: string
}

Example Request

Terminal window
# Create new app
curl -X POST \
-H "authorization: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"name": "My New App",
"icon": "https://example.com/icon.png",
"owner_org": "org_123"
}' \
https://api.capgo.app/app/

Success Response

{
"app_id": "My New App",
"created_at": "2024-01-01T00:00:00Z",
"default_upload_channel": "dev",
"icon_url": "https://example.com/icon.png",
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "My New App",
"owner_org": "org_123",
"retention": 2592000,
"updated_at": "2024-01-01T00:00:00Z"
}

PUT

https://api.capgo.app/app/:id

Update an existing app. The app ID is specified in the URL path.

Request Body

interface UpdateApp {
name?: string
icon?: string
retention?: number
}

Example Request

Terminal window
curl -X PUT \
-H "authorization: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated App Name",
"icon": "https://example.com/updated-icon.png",
"retention": 45
}' \
https://api.capgo.app/app/app_123

Success Response

{
"app_id": "app_123",
"created_at": "2024-01-01T00:00:00Z",
"default_upload_channel": "dev",
"icon_url": "https://example.com/updated-icon.png",
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Updated App Name",
"owner_org": "org_123",
"retention": 45,
"updated_at": "2024-01-01T00:00:00Z"
}

DELETE

https://api.capgo.app/app/:id

Delete an app and all associated resources. The app ID is specified in the URL path. Use with extreme caution as this action cannot be undone.

Example Request

Terminal window
curl -X DELETE \
-H "authorization: your-api-key" \
https://api.capgo.app/app/app_123

Success Response

{
"status": "ok"
}

Error Handling

Common error scenarios and their responses:

// App not found
{
"error": "App not found",
"status": "KO"
}
// Duplicate custom ID
{
"error": "Custom ID already in use",
"status": "KO"
}
// Invalid parameters
{
"error": "Invalid app configuration",
"status": "KO"
}
// Permission denied
{
"error": "Insufficient permissions to manage app",
"status": "KO"
}
// Organization access denied
{
"status": "You do not have access to this organization"
}

Common Use Cases

  1. Create New App
// Set up a new app
{
"name": "Production App",
"owner_org": "org_123"
}
  1. Update App Configuration
// Change app name and icon
{
"name": "Rebranded App Name",
"icon": "https://example.com/new-icon.png"
}
  1. Set Retention Policy
// Configure automatic bundle cleanup
{
"retention": 30 // Keep bundles for 30 days
}
  1. Get Apps by Organization
Terminal window
# List all apps in a specific organization
curl -H "authorization: your-api-key" \
"https://api.capgo.app/app/?org_id=org_123"

Resource Management

  1. Storage Optimization: Monitor storage usage and set appropriate retention policies
  2. Organization: Group related apps under a single organization
  3. Access Control: Manage which team members can modify app settings
  4. Backup Strategy: Back up critical app configurations and settings