[API] Custom capability permissions

I tried creating a new custom capability with the API command (POST). The command is accepted, but I get an empty response. No errors.

Granting permission “r:customcapability” caused an error message (Unexpected error). I couldn’t find what was required “w:customcapability” in the Cloud Connector Scope. Scope “r:customcapability” has been added to the Cloud Connector Scope.

What did I do wrong?

//QUERY PARAMETERS
"https://api.smartthings.com/v1/capabilities?namespace=xxxxxxxnamespace" 

// Custom capability body
{
    name: "Air Quality Alarm",
    attributes: {
      airQualityAlarm: {
        schema: {
          type: "object",
          properties: {
            value: {
              type: "string",
              enum: ["cleared", "alert"],
            },
          },
          additionalProperties: false,
          required: ["value"],
        },
        values: ["cleared", "alert"],
      },
    },
    commands: {},
  };

This is the first one you create, right?
The request should only have “https://api.smartthings.com/v1/capabilities”. The namespace is generated automatically, after that, you can use the namespace assigned to you.
Also, the format of the body doesn’t seem right, this is the normal body used in Postman, yours have extra commas in some places:

{
    "name": "Air Quality Alarm",
    "attributes": {
      "airQualityAlarm": {
        "schema": {
          "type": "object",
          "properties": {
            "value": {
              "type": "string",
              "enum": ["cleared", "alert"]
            }
          },
          "additionalProperties": false,
          "required": ["value"]
        },
        "values": ["cleared", "alert"]
      }
    },
    "commands": {}
  }

Also, are you trying to create the custom capability from a Cloud-Connector? Can you share more details about your use case, please?

Now I tried without query parameters and copied that example. Same result, no errors, no response(null).

Different limit values can be set on our device, which are sent to the user with notifications (For example air quality alarm, humidity alarm, stove alarm) It would be nice if this information could also be displayed in the SmartThings App. The main feature of the device is a stove guard. If you forget to close the stove, the device will automatically turn off the stove. Our long-term goal is to get a new device type into the SmartThings (Stove Guard).

Where are you trying to create the custom capability from? I just want to check if it’s a valid scenario. As you mention there are some limits that can be set for your device, I can think you want custom capabilities for that purpose but:

  1. They are not currently accepted for WWST certification
  2. And, if you’re trying to create them inside the connector, that might be causing the error because, as you mentioned, the scope w:customcapability is not available in the project configuration.