Create a new keyset

POST 

/v2/keysets

Creates a new keyset in a specified app either with default configuration or with optional configuration provided with request. For more configuration examples, see the config section of the API. In the response you will receive the keyset and the configuration with defaults set, if were not provided upon creation.

Note:

  • Creating a keyset requires both keyset:write and keyset-secret:read permissions on the app. The secretKeys field will always be included in the creation response.
  • Secret keys are only available at creation time and will not be returned in subsequent GET requests.
  • files.region, appContext.region, and dataSync.region cannot be changed after initial setup.
  • Enabling DataSync requires a configured DataSync region. Customer DataSync requests require Access Manager, which must be enabled separately using accessManager.enabled; enabling DataSync does not enable it automatically.

Request​

Example
{
  "keyset": {
    "name": "string",
    "type": "testing",
    "appId": "string",
    "id": "string",
    "publishKey": "string",
    "subscribeKey": "string",
    "createdAt": "string",
    "updatedAt": "string",
    "secretKeys": [
      {
        "secretKey": "string",
        "expiresAt": "string"
      }
    ]
  },
  "config": {
    "accessManager": {
      "enabled": false,
      "tokenRevoke": false
    },
    "files": {
      "enabled": false,
      "retention": 0,
      "region": "string"
    },
    "streamController": {
      "enabled": false,
      "wildcardSubscribe": false,
      "channelGroupLimit": 0
    },
    "appContext": {
      "enabled": false,
      "userMetadataEvents": false,
      "channelMetadataEvents": false,
      "membershipEvents": false,
      "disallowGetAllChannelMetadata": false,
      "disallowGetAllUserMetadata": false,
      "referentialIntegrity": false,
      "region": "string"
    },
    "dataSync": {
      "enabled": false,
      "region": "string"
    },
    "apns": {
      "enabled": false,
      "teamId": "string",
      "authKeyId": "string",
      "filename": "string"
    },
    "fcm": {
      "filename": "string"
    },
    "messagePersistence": {
      "enabled": false,
      "includePresenceEvents": false,
      "deleteFromHistory": false,
      "retention": 0
    },
    "presence": {
      "enabled": false,
      "deltas": false,
      "generateLeaveOnDisconnect": false,
      "streamFiltering": false,
      "activeNoticeChannel": "string",
      "announceMax": 0,
      "interval": 0,
      "debounce": 0,
      "enableLegacySDKTracking": false,
      "rules": [
        {}
      ]
    }
  }
}
Example
{
  "statusCode": 0,
  "error": "BadRequest",
  "message": [
    "string"
  ]
}
Example
{
  "statusCode": 0,
  "error": "Unauthorized",
  "message": [
    "string"
  ]
}
Example
{
  "statusCode": 0,
  "error": "Forbidden",
  "message": [
    "string"
  ]
}
Example
{
  "statusCode": 0,
  "error": "NotFound",
  "message": [
    "string"
  ]
}
Example
{
  "statusCode": 0,
  "error": "InternalError",
  "message": [
    "string"
  ]
}