/api/v1/accounts/{accountId}/types (POST)
POST
/api/v1/accounts/{accountId}/types
const url = 'https://example.com/api/v1/accounts/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/types';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","parentId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","name":"example","icon":"example","colour":"example","capabilities":["container"],"fieldGroups":["2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"],"defaultMeter":{"kind":"example","unit":"example"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/accounts/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/types \ --header 'Content-Type: application/json' \ --data '{ "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "parentId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example", "icon": "example", "colour": "example", "capabilities": [ "container" ], "fieldGroups": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "defaultMeter": { "kind": "example", "unit": "example" } }'Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”accountId
required
string format: uuid
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
Responses
Section titled “Responses”Default Response
Media typeapplication/json
object
id
required
string format: uuid
builtinKey
required
string | null
name
required
string | null
icon
required
string
colour
required
string | null
capabilities
required
Array<string>
resolvedCapabilities
required
Array<string>
isFieldGroup
required
boolean
fieldGroups
required
Array<string>
inUse
required
integer
rowVersion
required
integer
archivedAt
required
string | null
fields
required
Array<object>
object
id
required
string format: uuid
key
required
string
label
required
string | null
labelKey
required
string | null
kind
required
string
unit
required
string | null
options
required
Any of:
Array<string>
null
repeatable
required
boolean
required
required
boolean
secret
required
boolean
sort
required
integer
archivedAt
required
string | null
source
required
object
typeId
required
string format: uuid
via
required
string
rowVersion
required
integer
Example
{ "capabilities": [ "container" ], "resolvedCapabilities": [ "container" ], "fields": [ { "kind": "text", "source": { "via": "own" } } ]}