JavaScript
import Mobilerun from '@mobilerun/sdk';
const client = new Mobilerun({
apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
});
await client.devices.apps.revokePermission('POST_NOTIFICATIONS', {
deviceId: 'deviceId',
packageName: 'packageName',
});import os
from mobilerun_sdk import Mobilerun
client = Mobilerun(
api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"), # This is the default and can be omitted
)
client.devices.apps.revoke_permission(
permission="POST_NOTIFICATIONS",
device_id="deviceId",
package_name="packageName",
)curl --request DELETE \
--url https://api.mobilerun.ai/v1/devices/{deviceId}/apps/{packageName}/permissions/{permission} \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mobilerun.ai/v1/devices/{deviceId}/apps/{packageName}/permissions/{permission}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.mobilerun.ai/v1/devices/{deviceId}/apps/{packageName}/permissions/{permission}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.mobilerun.ai/v1/devices/{deviceId}/apps/{packageName}/permissions/{permission}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mobilerun.ai/v1/devices/{deviceId}/apps/{packageName}/permissions/{permission}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"$schema": "https://example.com/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Apps
Revoke app permission
Revokes an Android runtime permission from the package named in the path. The permission is given by its short name (e.g. POST_NOTIFICATIONS).
DELETE
/
devices
/
{deviceId}
/
apps
/
{packageName}
/
permissions
/
{permission}
JavaScript
import Mobilerun from '@mobilerun/sdk';
const client = new Mobilerun({
apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
});
await client.devices.apps.revokePermission('POST_NOTIFICATIONS', {
deviceId: 'deviceId',
packageName: 'packageName',
});import os
from mobilerun_sdk import Mobilerun
client = Mobilerun(
api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"), # This is the default and can be omitted
)
client.devices.apps.revoke_permission(
permission="POST_NOTIFICATIONS",
device_id="deviceId",
package_name="packageName",
)curl --request DELETE \
--url https://api.mobilerun.ai/v1/devices/{deviceId}/apps/{packageName}/permissions/{permission} \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mobilerun.ai/v1/devices/{deviceId}/apps/{packageName}/permissions/{permission}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.mobilerun.ai/v1/devices/{deviceId}/apps/{packageName}/permissions/{permission}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.mobilerun.ai/v1/devices/{deviceId}/apps/{packageName}/permissions/{permission}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mobilerun.ai/v1/devices/{deviceId}/apps/{packageName}/permissions/{permission}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"$schema": "https://example.com/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Revokes the permission directly, without any user interaction on the device. Counterpart to
grant-permission.
The short name expands to the full Android permission string: POST_NOTIFICATIONS becomes android.permission.POST_NOTIFICATIONS.
Not supported on iOS devices — the request fails with an unsupported-feature error.Authorizations
Bearer token via Authorization header
Headers
Required range:
x >= 0Path Parameters
Android runtime permission, short name (e.g. POST_NOTIFICATIONS).
Available options:
POST_NOTIFICATIONS Response
No Content
Was this page helpful?
⌘I