Change a permission rule

October 12, 2026

Table of contents

  1. Request Headers
  2. Request Body
  3. Responses
  4. Model
  5. Examples
  6. Try It

Change one standing rule of the Muse agent: allow or deny one website or app action. Find rules with GET /accounts/email/permissions. A rule is created when an approval is answered with allow_always.

  • allow: the agent goes ahead without asking.
  • deny: the agent may not do it.
  • ask: removes the rule, because asking is the default. The response then has removed: true.

https://api.useapi.net/v1/muse/accounts/email/permissions/permissionId

  • email is the email of an added account, URL-encoded in the path.
  • permissionId is the rule’s permissionId from GET /accounts/email/permissions, URL-encoded in the path (it contains :).
Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
Request Body
{
  "mode": "deny"
}
  • mode is required, one of the rule’s modes.
    Supported values: allow, ask, deny.
Responses
  • 200 OK — the rule as it is now. With mode: "ask" the rule is gone and the response has removed: true instead of rule.

    {
      "email": "[email protected]",
      "permissionId": "network_rule:hitl_domain_allow_nodesource_com_afdc93c7",
      "mode": "deny",
      "rule": {
        "permissionId": "network_rule:hitl_domain_allow_nodesource_com_afdc93c7",
        "type": "web",
        "mode": "deny",
        "modes": ["allow", "ask", "deny"],
        "title": "nodesource.com",
        "target": "nodesource.com:80,443",
        "note": null,
        "lifetime": "durable",
        "revocable": true,
        "created": null
      }
    }
    
    {
      "email": "[email protected]",
      "permissionId": "network_rule:hitl_domain_allow_nodesource_com_afdc93c7",
      "mode": "ask",
      "removed": true
    }
    
  • 400 Bad Request — mode is missing or is not one of the rule’s modes.

    {
      "error": "Parameter mode (sometimes) valid values: allow,ask,deny",
      "code": 400
    }
    
  • 401 Unauthorized — Invalid API token.

    {
      "error": "useapi.net ⁝ Unauthorized",
      "code": 401
    }
    
  • 404 Not Found — the account named by email is not added, or it has no rule with this permissionId.

    {
      "error": "Permission not found",
      "code": 404
    }
    
  • 502 Bad Gateway — Muse did not change the rule. Retry.

  • 503 Service Unavailable — Muse could not be read right now. Retry shortly.

    {
      "error": "Muse could not be read right now (…), please retry",
      "code": 503
    }
    
  • 596 Account Error

    The account needs your attention, and it is paused until you add it again. You receive an email when this happens. There are two causes.

    Meta asks for a security check on the account. Sign in once at muse.ai in a browser, complete the check, then add the account again with POST /accounts using the same email and password. The API keeps using its session, so no new sign-in is needed.

    {
      "error": "Account [email protected]: Meta asks for a security check on account [email protected] (\"This account must complete a security checkpoint on the web\"). Sign in once at https://muse.ai in a browser, complete the check, then add the account again with POST /accounts",
      "code": 596
    }
    

    Or Muse refused to sign the account in again when its session needed renewing, most often because the password was changed. Add the account again with the current password.

    {
      "error": "Account [email protected]: Muse refused to sign in account [email protected] (…). Update its password with POST /accounts, or sign in at https://muse.ai to clear the block, then re-add it",
      "code": 596
    }
    
Model
{ // TypeScript, all fields are optional
  email: string
  permissionId: string
  mode: string                 // the mode you sent
  rule?: Rule                  // allow / deny: the rule as it is now, see GET /accounts/{email}/permissions
  removed?: true               // ask: the rule is gone
  error?: string               // errors only
  code?: number                // errors only
}
Examples
  • EMAIL="[email protected]"
    curl -X POST -H "Authorization: Bearer …" \
         -H "Content-Type: application/json" \
         -d '{"mode": "deny"}' \
         "https://api.useapi.net/v1/muse/accounts/$(python3 -c "import urllib.parse,sys;print(urllib.parse.quote(sys.argv[1],safe=''))" "$EMAIL")/permissions/network_rule%3Ahitl_domain_allow_nodesource_com_afdc93c7"
    
  • const token = "API token";
    const email = "Previously added account email";
    const permissionId = "permissionId from GET /accounts/{email}/permissions";
    const apiUrl = `https://api.useapi.net/v1/muse/accounts/${encodeURIComponent(email)}/permissions/${encodeURIComponent(permissionId)}`;
    const response = await fetch(apiUrl, {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
        "Authorization": `Bearer ${token}`,
      },
      body: JSON.stringify({ mode: "deny" })
    });
    console.log("response", response.status, await response.json());
    
  • import requests
    from urllib.parse import quote
    token = "API token"
    email = "Previously added account email"
    permissionId = "permissionId from GET /accounts/{email}/permissions"
    apiUrl = f"https://api.useapi.net/v1/muse/accounts/{quote(email, safe='')}/permissions/{quote(permissionId, safe='')}"
    headers = {
        "Content-Type": "application/json",
        "Authorization" : f"Bearer {token}"
    }
    response = requests.post(apiUrl, headers=headers, json={"mode": "deny"})
    print(response, response.json())
    
Try It