Skip to content

Endpoints

This is the documentation of the public API of Capgo cloud

To access, add in the headers your API key as authorization.

Organizations

This endpoint allows you to manage organizations and their members.

GET

https://api.capgo.app/organization

Retrieve organization information. If orgId is provided in the parameters, returns a single organization. Otherwise, returns all accessible organizations.

interface Organization {
id: string
created_by: string
created_at: string
updated_at: string
logo: string | null
name: string
management_email: string
customer_id: string | null
}

Returns:

return Organization[] | Organization

POST

https://api.capgo.app/organization

Update an existing organization. Requires admin role.

interface OrganizationUpdate {
orgId: string
logo?: string
name?: string
management_email?: string
}

Requires a request body of type OrganizationUpdate.

On success, returns the following:

return { status: 'Organization updated', data: Organization }

PUT

https://api.capgo.app/organization

Create a new organization.

interface OrganizationCreate {
name: string
}

Requires a request body of type OrganizationCreate.

On success, returns the following:

return { status: 'Organization created', id: string }

API Keys

This endpoint allows you to manage API keys for accessing the Capgo API.

GET

https://api.capgo.app/apikey

Retrieve API keys for your account. Returns all accessible API keys.

interface ApiKey {
created_at: string | null
id: number
key: string
mode: 'read' | 'write' | 'upload' | 'all'
name: string
updated_at: string | null
user_id: string
}

Returns:

return ApiKey[]

POST

https://api.capgo.app/apikey

Create a new API key for a specific organization.

Query Parameters:

interface ApiKeyCreate {
org_id: string
mode: 'read' | 'write' | 'upload' | 'all'
}

Returns:

return { apikey: ApiKey }

DELETE

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

Delete an existing API key.

Parameters:

  • id: The API key to delete

On success, returns:

return { success: true }

On failure, returns:

return { error: string, supabaseError?: any }

Members (/organization/members)

GET

Retrieve organization members.

Requires a request body (query parameters) of type { orgId: string }.

On success, returns the following:

interface Member {
uid: string;
email: string;
image_url: string;
role: "invite_read" | "invite_upload" | "invite_write" | "invite_admin" | "invite_super_admin" | "read" | "upload" | "write" | "admin" | "super_admin";
}
return Member[]

DELETE

https://api.capgo.app/organization/members

Delete an organization member.

interface MemberDelete {
orgId: string
email: string
}

Requires a request body (query parameters) of type MemberDelete.

On success, returns the following:

return { status: 'OK' }

On failure, returns the following:

return { error: string, status: 'KO' }

Statistics

This endpoint allows you to retrieve various statistics about your apps and organizations.

GET /statistics/app/:app_id

Retrieve statistics for a specific app.

Query Parameters:

interface StatsQuery {
from: Date
to: Date
graph?: 'mau' | 'storage' | 'bandwidth'
}

Returns:

interface Stats {
date: string
mau: number // Monthly Active Users
storage: number // Storage usage in bytes
bandwidth: number // Bandwidth usage in bytes
}

If graph parameter is provided, returns an SVG image visualization of the requested metric.

GET /statistics/user

Retrieve aggregated statistics across all organizations the user has access to.

Query Parameters:

interface StatsQuery {
from: Date
to: Date
graph?: 'mau' | 'storage' | 'bandwidth'
}

Returns: If graph is not provided:

interface Stats {
date: string
mau: number // Monthly Active Users
storage: number // Storage usage in bytes
bandwidth: number // Bandwidth usage in bytes
}[]

If graph parameter is provided, returns an SVG image visualization of the requested metric.

GET /statistics/org/:org_id

Retrieve statistics for a specific organization.

Query Parameters:

interface StatsQuery {
from: Date
to: Date
graph?: 'mau' | 'storage' | 'bandwidth'
}

Returns: If graph is not provided:

interface Stats {
date: string
mau: number // Monthly Active Users
storage: number // Storage usage in bytes
bandwidth: number // Bandwidth usage in bytes
}[]

If graph parameter is provided, returns an SVG image visualization of the requested metric.

Channels

This endpoint allows you to check and modify all available Channels of your app

POST

https://api.capgo.app/channel

Send this to create or update channel

type disable_update = "major" | "minor" | "version_number" | "none"
interface ChannelSet {
app_id: string
channel: string
version?: string
public?: boolean
disableAutoUpdateUnderNative?: boolean
disableAutoUpdate?: disable_update
ios?: boolean
android?: boolean
allow_device_self_set?: boolean
allow_emulator?: boolean
allow_dev?: boolean
}

receive this:

{ "status": "ok" }

GET

https://api.capgo.app/channel

Send app_id as URL parameter and receive array of 50 first channels.
You can get the next one by sending page=1

interface Channel {
id: number;
created_at: string;
name: string;
app_id: string;
version: {
id: number,
name: string
};
created_by: string;
updated_at: string;
public: boolean; // default or not
disableAutoUpdateUnderNative: boolean;
disableAutoUpdate: boolean;
allow_emulator: boolean;
allow_dev: boolean;
}[]

and optionally channel name as URL parameter to receive one:

interface Channel {
id: number;
created_at: string;
name: string;
app_id: string;
version: {
id: number,
name: string
};
created_by: string;
updated_at: string;
public: boolean; // default or not
disableAutoUpdateUnderNative: boolean;
disableAutoUpdate: boolean;
allow_emulator: boolean;
allow_dev: boolean;
}

DELETE

https://api.capgo.app/channel

Send this as query parameter

interface Channel {
channel: string
app_id: string
}

receive this:

{ "status": "ok" }

Devices

This endpoint allows you to check and modify all devices link to your app

POST

https://api.capgo.app/device

Send this

interface DeviceLink {
app_id: string
device_id: string
version_id?: string // version name ( will be migrate to better name)
channel?: string // channel name
}

receive this:

{ "status": "ok" }

GET

https://api.capgo.app/device

Send app_id as URL parameter and receive array of 50 first devices.
You can get the next one by sending page=1

interface Device{
created_at?: string | undefined;
updated_at?: string | undefined;
device_id: string;
custom_id: string;
version: {
id: number,
name: string
};
app_id: string;
platform?: "ios" | "android" | undefined;
plugin_version: string;
os_version?: string | undefined;
version_build: string;
is_prod: boolean;
is_emulator: boolean;
}[]

and optionally device_id name as URL parameter to receive one:

interface Device {
created_at?: string | undefined;
updated_at?: string | undefined;
device_id: string;
version: {
id: number,
name: string
};
app_id: string;
platform?: "ios" | "android" | undefined;
plugin_version: string;
os_version?: string | undefined;
}

DELETE

This endpoint is for unlink channel and version override. You can’t delete a device from Capgo

https://api.capgo.app/device

Send this as query parameter

interface Device {
device_id: string
app_id: string
}

receive this:

{ "status": "ok" }

Bundles

This endpoint allows you to check and delete all bundles link to your app.

GET

https://api.capgo.app/bundle

Send app_id as URL parameter and receive array of 50 first bundles.
You can get the next one by sending page=1

interface Bundle {
app_id: string
bucket_id: string | null
checksum: string | null
created_at: string | null
deleted: boolean
external_url: string | null
id: number
minUpdateVersion: string | null
name: string
native_packages: Json[] | null
owner_org: string
r2_path: string | null
session_key: string | null
storage_provider: string
updated_at: string | null
user_id: string | null
}[]

DELETE

Delete one bundle in the Cloud

https://api.capgo.app/bundle

Send this as query parameter

interface Bundle {
app_id: string
version: string
}

receive this:

{ "status": "ok" }

Alternatively you can send

interface Bundle {
app_id: string
}

To delete all bundle.