Skip to Content

Apps

GET /api/v1/apps

List all apps for the authenticated user’s organization.

Authentication: JWT required

curl https://api.attributehq.com/v1/apps \ -H "Authorization: Bearer YOUR_JWT_TOKEN"

Response (200 OK):

{ "success": true, "data": { "apps": [ { "id": "770e8400-e29b-41d4-a716-446655440000", "name": "OPay Android", "platform": "android", "bundle_id": null, "package_name": "com.opay.app", "domain": null, "app_store_url": null, "play_store_url": "https://play.google.com/store/apps/details?id=com.opay.app", "created_at": "2025-01-15T10:30:00Z", "updated_at": "2025-01-15T10:30:00Z" } ] } }

POST /api/v1/apps

Create a new app.

Authentication: JWT required

curl -X POST https://api.attributehq.com/v1/apps \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "OPay Android", "platform": "android", "package_name": "com.opay.app", "play_store_url": "https://play.google.com/store/apps/details?id=com.opay.app" }'

Request Body:

FieldTypeRequiredDescription
namestringYesApp display name
platformstringYes"ios", "android", or "web"
bundle_idstringiOS onlyBundle identifier
apple_app_idstringNoApp Store numeric ID
package_namestringAndroid onlyPackage name
domainstringWeb onlyWebsite domain
app_store_urlstringNoApp Store URL (for click redirects)
play_store_urlstringNoPlay Store URL (for click redirects)

Response (201 Created):

{ "success": true, "data": { "app": { "id": "770e8400-e29b-41d4-a716-446655440000", "name": "OPay Android", "platform": "android", "package_name": "com.opay.app", "play_store_url": "https://play.google.com/store/apps/details?id=com.opay.app", "created_at": "2025-01-15T10:30:00Z" } } }

Errors: 400 validation error, 409 app already exists with that identifier


GET /api/v1/apps/:id

Get app details.

Authentication: JWT required

curl https://api.attributehq.com/v1/apps/770e8400-e29b-41d4-a716-446655440000 \ -H "Authorization: Bearer YOUR_JWT_TOKEN"

Response (200 OK): Same as create response, plus api_key_count field.

Errors: 404 app not found or doesn’t belong to user’s organization


PUT /api/v1/apps/:id

Update app settings.

Authentication: JWT required

curl -X PUT https://api.attributehq.com/v1/apps/770e8400-e29b-41d4-a716-446655440000 \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "OPay Android v2", "play_store_url": "https://play.google.com/store/apps/details?id=com.opay.app" }'

Updatable Fields: name, app_store_url, play_store_url


DELETE /api/v1/apps/:id

Delete an app and all associated data.

Authentication: JWT required

curl -X DELETE https://api.attributehq.com/v1/apps/770e8400-e29b-41d4-a716-446655440000 \ -H "Authorization: Bearer YOUR_JWT_TOKEN"

Response (200 OK):

{ "success": true, "data": { "success": true } }