Skip to content

Switch a feature

PUT
/api/v1/features/{id}
curl --request PUT \
--url 'http://localhost:3000/api/v1/features/example?context=organization' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "state": "on" }'

On or off, for every project of the organization or (projects) left to each; in a project, only while the organization lets each decide. Off means off everywhere at once: what it does is refused with feature_off, and nothing is deleted. A feature of the server’s is told by its hook and may refuse being turned on, with a reason (403); then nothing changes. Admin there.

Any caller; the scope needed is checked on what it acts on.

id
required
string

E.g. agents

context
string
default: organization
Allowed values: organization project

Where

Media typeapplication/json
object
state
required

On or off; at the organization, projects lets each project decide

string
Allowed values: on off projects

The feature, as it now is

Media typeapplication/json
object
data
required
object
id
required

Agents, shares, portals, hub, insights, or one of the server’s own (FEATURES_FILE)

string
name
required
string
description
required
string
off
required

What turning it off does

string | null
icon
required
string | null
builtin
required

The core’s own, rather than the server’s

boolean
levels
required

Where it is switched

Array<string>
Allowed values: organization project
default
required

Where nothing switched it

string
Allowed values: on off
available
required

The organization’s plan has it: false shows the way to one that does instead of a switch

boolean
manage
required

Where its own view is read, under Manage while it is on: a path on this origin when it is the app’s

string | null
rule
required

The organization’s switch: on or off in every project, or each project decides

string
Allowed values: on off projects
projects
required
Any of:
object
on
required
integer
>= -9007199254740991 <= 9007199254740991
total
required
integer
>= -9007199254740991 <= 9007199254740991
on
required

In the project: whether it is on there; null at the organization

boolean | null
from
required
Any of:
string
Allowed values: organization project default plan
editable
required

It can be switched here: in a project, only while the organization lets each decide

boolean
set
required
Any of:
object
by
required
string
at
required
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$/
Example
{
"data": {
"levels": [
"organization"
],
"default": "on",
"rule": "on",
"from": "organization"
}
}

An error

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
detail
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"detail": "example"
}
}