Authorized Apps

Manage apps the user has authorized

Overview

View and manage apps that the user has granted access to via OAuth.

Authentication: OAuth token
Required Scopes: authorized_apps:read, authorized_apps:write


List Authorized Apps

Get all apps the user has authorized.

Endpoint: GET /api/user/authorized-apps

const response = await fetch('https://hypery.ai/api/user/authorized-apps', {
  headers: {
    'Authorization': `Bearer ${oauthToken}`
  }
})
 
const { data } = await response.json()
console.log(data.apps)

Response:

{
  "success": true,
  "data": {
    "apps": [
      {
        "id": "507f...",
        "appId": "507f...",
        "app": {
          "name": "My App",
          "description": "App description",
          "image": "https://...icon.png",
          "category": "productivity",
          "verified": false,
          "clientId": "app_123...",
          "developer": {
            "name": "Acme Inc",
            "image": "https://...logo.png"
          }
        },
        "permissions": {
          "scopes": ["ai:chat", "user:read"],
          "grantedAt": "2025-11-01T10:00:00Z"
        },
        "spending": {
          "limits": {
            "daily": 10.00,
            "monthly": 100.00
          },
          "current": {
            "daily": 2.50,
            "monthly": 15.75
          }
        },
        "usage": {
          "totalRequests": 1250,
          "lastUsed": "2025-11-16T10:30:00Z"
        }
      }
    ]
  }
}

Output Fields

FieldTypeDescription
idstringAuthorization record ID
appIdstringApp ID
app.namestringApp name
app.clientIdstringOAuth client ID
permissions.scopesarrayGranted scopes
spending.limitsobjectSpending limits (daily, monthly)
spending.currentobjectCurrent spending
usage.totalRequestsnumberTotal API calls
usage.lastUsedstringLast usage timestamp

Revoke App Authorization

Remove access for an app.

Endpoint: DELETE /api/user/authorized-apps/:appId

await fetch(`https://hypery.ai/api/user/authorized-apps/${appId}`, {
  method: 'DELETE',
  headers: {
    'Authorization': `Bearer ${oauthToken}`
  }
})

Response:

{
  "success": true,
  "message": "App authorization revoked"
}

Get Spending Limits

Get spending limits for an authorized app.

Endpoint: GET /api/user/authorized-apps/:appId/limits

const response = await fetch(
  `https://hypery.ai/api/user/authorized-apps/${appId}/limits`,
  { headers: { 'Authorization': `Bearer ${oauthToken}` } }
)
 
const { limits } = await response.json()

Update Spending Limits

Set spending limits for an authorized app.

Endpoint: PUT /api/user/authorized-apps/:appId/limits

const response = await fetch(
  `https://hypery.ai/api/user/authorized-apps/${appId}/limits`,
  {
    method: 'PUT',
    headers: {
      'Authorization': `Bearer ${oauthToken}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      daily: 10.00,
      monthly: 100.00
    })
  }
)

Input Parameters

ParameterTypeRequiredDescription
dailynumberNoDaily spending limit in dollars
monthlynumberNoMonthly spending limit in dollars

Manage App Permissions

Update App Scopes

Modify which permissions an authorized app has access to.

Endpoint: PATCH /api/user/authorized-apps/:appId/permissions

const response = await fetch(
  `https://hypery.ai/api/user/authorized-apps/${appId}/permissions`,
  {
    method: 'PATCH',
    headers: {
      'Authorization': `Bearer ${oauthToken}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      scopes: ['read', 'ai:chat', 'ai:models']
    })
  }
)
 
const result = await response.json()

Input Parameters

ParameterTypeRequiredDescription
scopesstring[]YesArray of permission scopes (cannot be empty)

Response:

{
  "success": true,
  "scopes": ["read", "ai:chat", "ai:models"]
}

Error (400 - Cannot remove all permissions):

{
  "error": "Cannot remove all permissions. Please revoke access instead."
}

Revoke App Access (POST)

Completely revoke an app's access to your account.

Endpoint: POST /api/user/authorized-apps/:appId/revoke

const response = await fetch(
  `https://hypery.ai/api/user/authorized-apps/${appId}/revoke`,
  {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${oauthToken}`
    }
  }
)
 
const result = await response.json()

Response:

{
  "success": true,
  "message": "Access revoked successfully"
}

Next Steps