Skip to content

Create app group

POST/app-groups

Mobile API · AppGroups

Create app group.

Required permissionmobile.app-group:create

Parameters

Name In Type Required Description
X-Tenant-ID header string (uuid) Yes Tenant ID.
fields query array of string No The fields to return in a partial response.
view query string No Type of view to be returned in response.
Must be one of: basic, summary, full.

Request body

Content type: application/json

Request body fields

namestringrequired
The app group name.
Must be at most 255 characters long.
appsarray of objectrequired
A list of app group entries.
Must contain 1–10000 items. Items must be unique.
App group entry for create or update requests.
Show child attributesHide child attributes
identifierstringrequired
The app identifier, for example, the package name.
Must be at most 255 characters long.
namestringrequired
The app name.
Must be at most 255 characters long.
linkstring (url)
A link to the app.
Must be at most 500 characters long.
platformstring (enum)required
The device platform, i.e. the operating system.
Must be one of: iOS, macOS, android, chrome, windows.

Request samples

curl -X POST "https://api-<data-region>.central.sophos.com/mobile/v1/app-groups" -H "Authorization: Bearer <access-token>" -H "X-Tenant-ID: <tenant-id>" -H "Content-Type: application/json" -d "{
  \"name\": \"My app group\",
  \"apps\": [
    {
      \"identifier\": \"com.sophos.smsec\",
      \"name\": \"Sophos Intercept X for Mobile\",
      \"link\": \"https://www.sophos.com\"
    }
  ],
  \"platform\": \"chrome\"
}"

import requests

response = requests.post(
    "https://api-<data-region>.central.sophos.com/mobile/v1/app-groups",
    headers={
        "Authorization": "Bearer <access-token>",
        "X-Tenant-ID": "<tenant-id>",
        "Content-Type": "application/json",
    },
    json={   'name': 'My app group',
    'apps': [   {   'identifier': 'com.sophos.smsec',
                    'name': 'Sophos Intercept X for Mobile',
                    'link': 'https://www.sophos.com'}],
    'platform': 'chrome'},
)
print(response.json())

$headers = @{
    "Authorization" = "Bearer <access-token>"
    "X-Tenant-ID" = "<tenant-id>"
    "Content-Type" = "application/json"
}
$body = '{
  "name": "My app group",
  "apps": [
    {
      "identifier": "com.sophos.smsec",
      "name": "Sophos Intercept X for Mobile",
      "link": "https://www.sophos.com"
    }
  ],
  "platform": "chrome"
}'
Invoke-RestMethod -Method POST -Uri "https://api-<data-region>.central.sophos.com/mobile/v1/app-groups" -Headers $headers -Body $body -ContentType "application/json"

package main

import (
    "fmt"
    "io"
    "net/http"
    "strings"
)

func main() {
    req, err := http.NewRequest("POST", "https://api-<data-region>.central.sophos.com/mobile/v1/app-groups", strings.NewReader(`{
  "name": "My app group",
  "apps": [
    {
      "identifier": "com.sophos.smsec",
      "name": "Sophos Intercept X for Mobile",
      "link": "https://www.sophos.com"
    }
  ],
  "platform": "chrome"
}`))
    if err != nil {
        panic(err)
    }
    req.Header.Set("Authorization", "Bearer <access-token>")
    req.Header.Set("X-Tenant-ID", "<tenant-id>")
    req.Header.Set("Content-Type", "application/json")

    resp, err := http.DefaultClient.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    body, _ := io.ReadAll(resp.Body)
    fmt.Println(string(body))
}

const response = await fetch("https://api-<data-region>.central.sophos.com/mobile/v1/app-groups", {
  method: "POST",
  headers: {
    "Authorization": "Bearer <access-token>",
    "X-Tenant-ID": "<tenant-id>",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
  "name": "My app group",
  "apps": [
    {
      "identifier": "com.sophos.smsec",
      "name": "Sophos Intercept X for Mobile",
      "link": "https://www.sophos.com"
    }
  ],
  "platform": "chrome"
}),
});
const data = await response.json();
console.log(data);

Responses

201 — The new app group.

Response fields

idstring (uuid)required
ID of the app group.
tenantobjectrequired
Tenant this resource belongs to.
Show child attributesHide child attributes
idstring (uuid)required
namestring
namestring
The app group name.
Must be at most 255 characters long.
countinteger
The number of apps in this app group.
platformstring (enum)
The device platform, i.e. the operating system.
Must be one of: iOS, macOS, android, chrome, windows.
createdAtstring (date-time)
Time when the app group was created.
createdByobject
Principal reference.
Show child attributesHide child attributes
idstring (uuid)
Principal ID.
typestring (enum)required
Principal type.
Must be one of: user, service, system.
accountIdstring (uuid)
Account ID.
accountTypestring (enum)
Account type.
Must be one of: partner, tenant, organization.
namestring
Principal name or email.
updatedAtstring (date-time)
Time when the app group was last updated.
updatedByobject
Principal reference.
Show child attributesHide child attributes
idstring (uuid)
Principal ID.
typestring (enum)required
Principal type.
Must be one of: user, service, system.
accountIdstring (uuid)
Account ID.
accountTypestring (enum)
Account type.
Must be one of: partner, tenant, organization.
namestring
Principal name or email.
appsarray of object
A list of app group entries.
Must contain 1–10000 items. Items must be unique.
App group entry for mobile device.
Show child attributesHide child attributes
identifierstring
The app identifier, for example, the package name.
Must be at most 255 characters long.
namestring
The app name.
Must be at most 255 characters long.
linkstring (url)
A link to the app.
Must be at most 500 characters long.

Errors

Status Meaning
400 Invalid request.
401 Unauthorized.
403 Forbidden.
409 Conflicting modification.
422 Maximum number of app groups exceeded.
429 Too many requests. See Retry-After header.
500 Internal server error.

All error responses share the same shape — see the error response object.

Response examples

201

{
  "id": "c9c9b03c-5cf7-4fe1-93bb-246afc9044d2",
  "tenant": {
    "id": "b8a75c7d-7492-4009-9f95-8c815551dc55",
    "name": "The name of the tenant"
  },
  "name": "My app group",
  "count": 1,
  "platform": "android"
}

See the guide for a narrative walkthrough of this API.