Capabilities
Create a Capability
Changed onCreate a Capability.
post/capabilities
Request
- Base URLhttps://api.smartthings.com/v1
- AuthOAuth 2Implicithttps://auth-global.api.smartthings.comScopesw:customcapability
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Query parameters
namespacestring
The namespace of the Capability
Headers
X-ST-Organizationstring ^(?:([0-9a-fA-F]{32})|([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}))$
Organization id. If not provided, default user organization will be used.
Request body
Example request
{
"name": "Color Temperature",
"ephemeral": true,
"attributes": {
"colorTemperature": {
"schema": {
"type": "object",
"properties": {
"value": {
"type": "integer",
"minimum": 1,
"maximum": 30000
},
"unit": {
"type": "string",
"enum": [
"K"
],
"default": "K"
}
},
"additionalProperties": false
},
"required": [
"value"
]
}
},
"commands": {
"setColorTemperature": {
"arguments": [
{
"name": "temperature",
"optional": false,
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 30000
}
}
]
}
}
}Response
The custom Capability
Example response
{
"id": "namespace.colorTemperature",
"version": 1,
"name": "Color Temperature",
"ephemeral": true,
"attributes": {
"colorTemperature": {
"schema": {
"type": "object",
"properties": {
"value": {
"type": "integer",
"minimum": 1,
"maximum": 30000
},
"unit": {
"type": "string",
"enum": [
"K"
],
"default": "K"
},
"required": [
"value"
]
}
}
}
},
"commands": {
"setColorTemperature": {
"arguments": [
{
"name": "temperature",
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 30000
}
}
]
}
}
}Changes
- info
added the new optional
headerrequest parameterX-ST-Organization
- info