# DevCycle

> Create and update DevCycle feature flags and variables, turn features on or off in an environment, read audit logs and evaluation counts, and follow new and changed features.

App · 25 actions. Web page: https://docs.lodol.com/docs/integrations/devcycle

## Actions

### Archive or restore variable

Archive a variable no longer used in code, or make an archived one active again.

**Inputs**

- Project (`project`, text, required): The project.
- Variable (`variable`, text, required): The variable.
- Status (`status`, text, required): The variable's new status. One of: `active`, `archived`.

**Outputs**

- `data` (object): The response from DevCycle.

**Example output**

```json
{
  "data": {
    "_feature": "example",
    "_id": "example",
    "_project": "example",
    "createdAt": "example",
    "description": "example",
    "key": "example",
    "name": "example",
    "persistent": true,
    "source": "example",
    "status": "example",
    "tags": [
      "example"
    ],
    "type": "example",
    "updatedAt": "example"
  }
}
```

### Create feature

Create a feature (feature flag), optionally turned on in some environments.

**Inputs**

- Project (`project`, text, required): The project.
- Key (`key`, text, required): The feature's key, used in code and unique in the project. Lower-case letters, numbers and the characters _ - and . only.
- Name (`name`, text, required): The display name, up to 100 characters.
- Description (`description`, text): A description, up to 1000 characters.
- Type (`type`, text): The kind of feature. One of: `release`, `experiment`, `permission`, `ops`.
- Tags (`tags`, list): Tags to organize it on the dashboard.
- Turn on in (`turn_on_in`, list): Environments to turn the feature's targeting on in. Leave empty to create it turned off everywhere.

**Outputs**

- `data` (object): The response from DevCycle.

**Example output**

```json
{
  "data": {
    "_id": "example",
    "_project": "example",
    "configurations": [
      {
        "_environment": "example",
        "_feature": "example",
        "hasStaticConfig": true,
        "startedAt": "example",
        "status": "example",
        "targets": [
          {}
        ],
        "updatedAt": "example"
      }
    ],
    "controlVariation": "example",
    "createdAt": "example",
    "description": "example",
    "key": "example",
    "name": "example",
    "source": "example",
    "staticVariation": "example",
    "status": "example",
    "tags": [
      "example"
    ],
    "type": "example",
    "updatedAt": "example",
    "variables": [
      {
        "_feature": "example",
        "_id": "example",
        "_project": "example",
        "createdAt": "example",
        "description": "example",
        "key": "example",
        "name": "example",
        "persistent": true,
        "source": "example",
        "status": "example",
        "tags": [
          "example"
        ],
        "type": "example",
        "updatedAt": "example"
      }
    ],
    "variations": [
      {
        "_id": "example",
        "key": "example",
        "name": "example",
        "variables": {}
      }
    ]
  }
}
```

### Create variable

Create a variable, optionally as part of a feature.

**Inputs**

- Project (`project`, text, required): The project.
- Key (`key`, text, required): The variable's key, used in code and unique in the project. Lower-case letters, numbers and the characters _ - and . only.
- Type (`type`, text, required): The kind of value it holds. One of: `String` (Text), `Boolean` (True or false), `Number`, `JSON`.
- Name (`name`, text): The display name, up to 100 characters.
- Description (`description`, text): A description, up to 1000 characters.
- Feature (`feature`, text): The feature it belongs to. Leave empty for none.
- Tags (`tags`, list): Tags to organize it on the dashboard.

**Outputs**

- `data` (object): The response from DevCycle.

**Example output**

```json
{
  "data": {
    "_feature": "example",
    "_id": "example",
    "_project": "example",
    "createdAt": "example",
    "description": "example",
    "key": "example",
    "name": "example",
    "persistent": true,
    "source": "example",
    "status": "example",
    "tags": [
      "example"
    ],
    "type": "example",
    "updatedAt": "example"
  }
}
```

### Create variation

Add a variation to a feature, with the value it serves for each variable.

**Inputs**

- Project (`project`, text, required): The project.
- Feature (`feature`, text, required): The feature.
- Key (`key`, text, required): The variation's key, unique in the feature. Lower-case letters, numbers and the characters _ - and . only.
- Name (`name`, text, required): The variation's display name, up to 100 characters.
- Variable values (`variables`, object): The value this variation serves for each variable, by variable key.

**Outputs**

- `data` (object): The response from DevCycle.

**Example output**

```json
{
  "data": {
    "_id": "example",
    "_project": "example",
    "configurations": [
      {
        "_environment": "example",
        "_feature": "example",
        "hasStaticConfig": true,
        "startedAt": "example",
        "status": "example",
        "targets": [
          {}
        ],
        "updatedAt": "example"
      }
    ],
    "controlVariation": "example",
    "createdAt": "example",
    "description": "example",
    "key": "example",
    "name": "example",
    "source": "example",
    "staticVariation": "example",
    "status": "example",
    "tags": [
      "example"
    ],
    "type": "example",
    "updatedAt": "example",
    "variables": [
      {
        "_feature": "example",
        "_id": "example",
        "_project": "example",
        "createdAt": "example",
        "description": "example",
        "key": "example",
        "name": "example",
        "persistent": true,
        "source": "example",
        "status": "example",
        "tags": [
          "example"
        ],
        "type": "example",
        "updatedAt": "example"
      }
    ],
    "variations": [
      {
        "_id": "example",
        "key": "example",
        "name": "example",
        "variables": {}
      }
    ]
  }
}
```

### Delete feature

Delete a feature, and optionally its variables.

**Inputs**

- Project (`project`, text, required): The project.
- Feature (`feature`, text, required): The feature.
- Delete variables (`delete_variables`, true/false): Also delete the feature's variables.

**Outputs**

- `data` (object): The response from DevCycle.

**Example output**

```json
{
  "data": {}
}
```

### Delete variable

Delete a variable.

**Inputs**

- Project (`project`, text, required): The project.
- Variable (`variable`, text, required): The variable.

**Outputs**

- `data` (object): The response from DevCycle.

**Example output**

```json
{
  "data": {}
}
```

### Get audience

Get an audience's name and the filters that define it.

**Inputs**

- Project (`project`, text, required): The project.
- Audience (`audience`, text, required): The audience.

**Outputs**

- `data` (object): The response from DevCycle.

**Example output**

```json
{
  "data": {
    "_id": "example",
    "_project": "example",
    "createdAt": "example",
    "description": "example",
    "filters": {},
    "key": "example",
    "name": "example",
    "tags": [
      "example"
    ],
    "updatedAt": "example"
  }
}
```

### Get environment

Get an environment's name, key and type.

**Inputs**

- Project (`project`, text, required): The project.
- Environment (`environment`, text, required): The environment.

**Outputs**

- `data` (object): The response from DevCycle.

**Example output**

```json
{
  "data": {
    "_id": "example",
    "_project": "example",
    "color": "example",
    "createdAt": "example",
    "description": "example",
    "key": "example",
    "name": "example",
    "type": "example",
    "updatedAt": "example"
  }
}
```

### Get feature

Get a feature with its variations, variables and targeting in each environment.

**Inputs**

- Project (`project`, text, required): The project.
- Feature (`feature`, text, required): The feature.

**Outputs**

- `data` (object): The response from DevCycle.

**Example output**

```json
{
  "data": {
    "_id": "example",
    "_project": "example",
    "configurations": [
      {
        "_environment": "example",
        "_feature": "example",
        "hasStaticConfig": true,
        "startedAt": "example",
        "status": "example",
        "targets": [
          {}
        ],
        "updatedAt": "example"
      }
    ],
    "controlVariation": "example",
    "createdAt": "example",
    "description": "example",
    "key": "example",
    "name": "example",
    "source": "example",
    "staticVariation": "example",
    "status": "example",
    "tags": [
      "example"
    ],
    "type": "example",
    "updatedAt": "example",
    "variables": [
      {
        "_feature": "example",
        "_id": "example",
        "_project": "example",
        "createdAt": "example",
        "description": "example",
        "key": "example",
        "name": "example",
        "persistent": true,
        "source": "example",
        "status": "example",
        "tags": [
          "example"
        ],
        "type": "example",
        "updatedAt": "example"
      }
    ],
    "variations": [
      {
        "_id": "example",
        "key": "example",
        "name": "example",
        "variables": {}
      }
    ]
  }
}
```

### Get feature audit log

List the changes made to a feature, newest first, with who made them.

**Inputs**

- Project (`project`, text, required): The project.
- Feature (`feature`, text, required): The feature.
- Environment (`environment`, text): Only changes to this environment's targeting.
- From (`start_date`, date and time): Only changes made at or after this time.
- To (`end_date`, date and time): Only changes made at or before this time.
- Records per page (`per_page`, number): How many changes to return, up to 1000. Leave empty for 100. From 1 to 1000.
- Page (`page`, number): Which page of changes to return. Leave empty for the first. At least 1.

**Outputs**

- `data` (list): The response from DevCycle.

**Example output**

```json
{
  "data": [
    {
      "a0_user": "example",
      "changes": [
        {}
      ],
      "date": "example"
    }
  ]
}
```

### Get feature evaluations

Count how many times a feature's variables were evaluated, by hour, day or month.

**Inputs**

- Project (`project`, text, required): The project.
- Feature (`feature`, text, required): The feature.
- From (`start`, date and time): The start of the period. Leave empty for DevCycle's default.
- To (`end`, date and time): The end of the period. Leave empty for now.
- Environment (`environment`, text): Only this environment's evaluations.
- Group by (`period`, text): How to group the counts. Leave empty for DevCycle's default. One of: `hour`, `day`, `month`.
- SDK type (`sdk_type`, text): Only evaluations from this kind of SDK. One of: `client` (Client-side SDKs), `server` (Server-side SDKs), `mobile` (Mobile SDKs), `api`.

**Outputs**

- `data` (object): The response from DevCycle.

**Example output**

```json
{
  "data": {
    "cached": true,
    "result": {
      "evaluations": [
        {}
      ]
    },
    "updatedAt": "example"
  }
}
```

### Get feature targeting

Get whether a feature is on in each environment, with its targeting rules.

**Inputs**

- Project (`project`, text, required): The project.
- Feature (`feature`, text, required): The feature.
- Environment (`environment`, text): Only this environment. Leave empty for every environment.

**Outputs**

- `data` (list): The response from DevCycle.

**Example output**

```json
{
  "data": [
    {
      "_environment": "example",
      "_feature": "example",
      "hasStaticConfig": true,
      "startedAt": "example",
      "status": "example",
      "targets": [
        {}
      ],
      "updatedAt": "example"
    }
  ]
}
```

### Get project

Get a project's name, key and description.

**Inputs**

- Project (`project`, text, required): The project.

**Outputs**

- `data` (object): The response from DevCycle.

**Example output**

```json
{
  "data": {
    "_id": "example",
    "_organization": "example",
    "color": "example",
    "createdAt": "example",
    "description": "example",
    "key": "example",
    "name": "example",
    "updatedAt": "example"
  }
}
```

### Get variable

Get a variable's key, type, status and feature.

**Inputs**

- Project (`project`, text, required): The project.
- Variable (`variable`, text, required): The variable.

**Outputs**

- `data` (object): The response from DevCycle.

**Example output**

```json
{
  "data": {
    "_feature": "example",
    "_id": "example",
    "_project": "example",
    "createdAt": "example",
    "description": "example",
    "key": "example",
    "name": "example",
    "persistent": true,
    "source": "example",
    "status": "example",
    "tags": [
      "example"
    ],
    "type": "example",
    "updatedAt": "example"
  }
}
```

### List audiences

List a project's reusable audiences (groups of users to target).

**Inputs**

- Project (`project`, text, required): The project.
- Search (`search`, text): Only records whose name or key contains this, at least 3 characters.
- Sort by (`sort_by`, text): What to sort by. Leave empty for date created. One of: `createdAt` (Date created), `updatedAt` (Date updated), `name`, `key`.
- Sort order (`sort_order`, text): The sort direction. Leave empty for newest or Z first. One of: `asc` (Oldest or A first), `desc` (Newest or Z first).
- Records per page (`per_page`, number): How many records to return, up to 1000. Leave empty for 100. From 1 to 1000.
- Page (`page`, number): Which page of records to return. Leave empty for the first. At least 1.

**Outputs**

- `data` (list): The response from DevCycle.

**Example output**

```json
{
  "data": [
    {
      "_id": "example",
      "_project": "example",
      "createdAt": "example",
      "description": "example",
      "filters": {},
      "key": "example",
      "name": "example",
      "tags": [
        "example"
      ],
      "updatedAt": "example"
    }
  ]
}
```

### List environments

List a project's environments, such as development, staging and production.

**Inputs**

- Project (`project`, text, required): The project.
- Search (`search`, text): Only records whose name or key contains this, at least 3 characters.
- Sort by (`sort_by`, text): What to sort by. Leave empty for date created. One of: `createdAt` (Date created), `updatedAt` (Date updated), `name`, `key`.
- Sort order (`sort_order`, text): The sort direction. Leave empty for newest or Z first. One of: `asc` (Oldest or A first), `desc` (Newest or Z first).
- Records per page (`per_page`, number): How many records to return, up to 1000. Leave empty for 100. From 1 to 1000.
- Page (`page`, number): Which page of records to return. Leave empty for the first. At least 1.

**Outputs**

- `data` (list): The response from DevCycle.

**Example output**

```json
{
  "data": [
    {
      "_id": "example",
      "_project": "example",
      "color": "example",
      "createdAt": "example",
      "description": "example",
      "key": "example",
      "name": "example",
      "type": "example",
      "updatedAt": "example"
    }
  ]
}
```

### List features

List a project's features (feature flags), optionally only of one type or status.

**Inputs**

- Project (`project`, text, required): The project.
- Type (`type`, text): Only features of this type. One of: `release`, `experiment`, `permission`, `ops`.
- Status (`status`, text): Only features with this status. One of: `active`, `complete` (Complete (serve one variation to everyone)), `archived`.
- Search (`search`, text): Only records whose name or key contains this, at least 3 characters.
- Sort by (`sort_by`, text): What to sort by. Leave empty for date created. One of: `createdAt` (Date created), `updatedAt` (Date updated), `name`, `key`.
- Sort order (`sort_order`, text): The sort direction. Leave empty for newest or Z first. One of: `asc` (Oldest or A first), `desc` (Newest or Z first).
- Records per page (`per_page`, number): How many records to return, up to 1000. Leave empty for 100. From 1 to 1000.
- Page (`page`, number): Which page of records to return. Leave empty for the first. At least 1.

**Outputs**

- `data` (list): The response from DevCycle.

**Example output**

```json
{
  "data": [
    {
      "_id": "example",
      "_project": "example",
      "configurations": [
        {
          "_environment": "example",
          "_feature": "example",
          "hasStaticConfig": true,
          "startedAt": "example",
          "status": "example",
          "targets": [
            {}
          ],
          "updatedAt": "example"
        }
      ],
      "controlVariation": "example",
      "createdAt": "example",
      "description": "example",
      "key": "example",
      "name": "example",
      "source": "example",
      "staticVariation": "example",
      "status": "example",
      "tags": [
        "example"
      ],
      "type": "example",
      "updatedAt": "example",
      "variables": [
        {
          "_feature": "example",
          "_id": "example",
          "_project": "example",
          "createdAt": "example",
          "description": "example",
          "key": "example",
          "name": "example",
          "persistent": true,
          "source": "example",
          "status": "example",
          "tags": [
            "example"
          ],
          "type": "example",
          "updatedAt": "example"
        }
      ],
      "variations": [
        {
          "_id": "example",
          "key": "example",
          "name": "example",
          "variables": {}
        }
      ]
    }
  ]
}
```

### List metrics

List a project's metrics, the events experiments are measured by.

**Inputs**

- Project (`project`, text, required): The project.
- Search (`search`, text): Only records whose name or key contains this, at least 3 characters.
- Sort by (`sort_by`, text): What to sort by. Leave empty for date created. One of: `createdAt` (Date created), `updatedAt` (Date updated), `name`, `key`.
- Sort order (`sort_order`, text): The sort direction. Leave empty for newest or Z first. One of: `asc` (Oldest or A first), `desc` (Newest or Z first).
- Records per page (`per_page`, number): How many records to return, up to 1000. Leave empty for 100. From 1 to 1000.
- Page (`page`, number): Which page of records to return. Leave empty for the first. At least 1.

**Outputs**

- `data` (list): The response from DevCycle.

**Example output**

```json
{
  "data": [
    {
      "_id": "example",
      "_project": "example",
      "createdAt": "example",
      "description": "example",
      "dimension": "example",
      "event": "example",
      "key": "example",
      "name": "example",
      "optimize": "example",
      "updatedAt": "example"
    }
  ]
}
```

### List projects

List the projects the API credentials can see.

**Inputs**

- Search (`search`, text): Only records whose name or key contains this, at least 3 characters.
- Sort by (`sort_by`, text): What to sort by. Leave empty for date created. One of: `createdAt` (Date created), `updatedAt` (Date updated), `name`, `key`.
- Sort order (`sort_order`, text): The sort direction. Leave empty for newest or Z first. One of: `asc` (Oldest or A first), `desc` (Newest or Z first).
- Records per page (`per_page`, number): How many records to return, up to 1000. Leave empty for 100. From 1 to 1000.
- Page (`page`, number): Which page of records to return. Leave empty for the first. At least 1.

**Outputs**

- `data` (list): The response from DevCycle.

**Example output**

```json
{
  "data": [
    {
      "_id": "example",
      "_organization": "example",
      "color": "example",
      "createdAt": "example",
      "description": "example",
      "key": "example",
      "name": "example",
      "updatedAt": "example"
    }
  ]
}
```

### List variables

List a project's variables, optionally only one feature's, one type or one status.

**Inputs**

- Project (`project`, text, required): The project.
- Feature (`feature`, text): Only this feature's variables.
- Type (`type`, text): Only variables of this type. One of: `String` (Text), `Boolean` (True or false), `Number`, `JSON`.
- Status (`status`, text): Only active or only archived variables. One of: `active`, `archived`.
- Search (`search`, text): Only records whose name or key contains this, at least 3 characters.
- Sort by (`sort_by`, text): What to sort by. Leave empty for date created. One of: `createdAt` (Date created), `updatedAt` (Date updated), `name`, `key`.
- Sort order (`sort_order`, text): The sort direction. Leave empty for newest or Z first. One of: `asc` (Oldest or A first), `desc` (Newest or Z first).
- Records per page (`per_page`, number): How many records to return, up to 1000. Leave empty for 100. From 1 to 1000.
- Page (`page`, number): Which page of records to return. Leave empty for the first. At least 1.

**Outputs**

- `data` (list): The response from DevCycle.

**Example output**

```json
{
  "data": [
    {
      "_feature": "example",
      "_id": "example",
      "_project": "example",
      "createdAt": "example",
      "description": "example",
      "key": "example",
      "name": "example",
      "persistent": true,
      "source": "example",
      "status": "example",
      "tags": [
        "example"
      ],
      "type": "example",
      "updatedAt": "example"
    }
  ]
}
```

### List variations

List a feature's variations and the variable values each serves.

**Inputs**

- Project (`project`, text, required): The project.
- Feature (`feature`, text, required): The feature.

**Outputs**

- `data` (list): The response from DevCycle.

**Example output**

```json
{
  "data": [
    {
      "_id": "example",
      "key": "example",
      "name": "example",
      "variables": {}
    }
  ]
}
```

### Turn feature on or off

Turn a feature's targeting on or off in one environment.

**Inputs**

- Project (`project`, text, required): The project.
- Feature (`feature`, text, required): The feature.
- Environment (`environment`, text, required): The environment to change.
- Targeting (`status`, text, required): On serves the feature's targeting rules; off serves everyone the default. One of: `active`, `inactive` (Off).

**Outputs**

- `data` (object): The response from DevCycle.

**Example output**

```json
{
  "data": {
    "_environment": "example",
    "_feature": "example",
    "hasStaticConfig": true,
    "startedAt": "example",
    "status": "example",
    "targets": [
      {}
    ],
    "updatedAt": "example"
  }
}
```

### Update feature

Rename a feature or change its description, type or tags.

**Inputs**

- Project (`project`, text, required): The project.
- Feature (`feature`, text, required): The feature.
- Name (`name`, text): The display name, up to 100 characters.
- Description (`description`, text): A description, up to 1000 characters.
- Type (`type`, text): The kind of feature. One of: `release`, `experiment`, `permission`, `ops`.
- Tags (`tags`, list): Tags to organize it on the dashboard.

**Outputs**

- `data` (object): The response from DevCycle.

**Example output**

```json
{
  "data": {
    "_id": "example",
    "_project": "example",
    "configurations": [
      {
        "_environment": "example",
        "_feature": "example",
        "hasStaticConfig": true,
        "startedAt": "example",
        "status": "example",
        "targets": [
          {}
        ],
        "updatedAt": "example"
      }
    ],
    "controlVariation": "example",
    "createdAt": "example",
    "description": "example",
    "key": "example",
    "name": "example",
    "source": "example",
    "staticVariation": "example",
    "status": "example",
    "tags": [
      "example"
    ],
    "type": "example",
    "updatedAt": "example",
    "variables": [
      {
        "_feature": "example",
        "_id": "example",
        "_project": "example",
        "createdAt": "example",
        "description": "example",
        "key": "example",
        "name": "example",
        "persistent": true,
        "source": "example",
        "status": "example",
        "tags": [
          "example"
        ],
        "type": "example",
        "updatedAt": "example"
      }
    ],
    "variations": [
      {
        "_id": "example",
        "key": "example",
        "name": "example",
        "variables": {}
      }
    ]
  }
}
```

### Update feature status

Mark a feature active, complete (one variation served to everyone) or archived.

**Inputs**

- Project (`project`, text, required): The project.
- Feature (`feature`, text, required): The feature.
- Status (`status`, text, required): The feature's new status. One of: `active`, `complete` (Complete (serve one variation to everyone)), `archived`.
- Variation to serve (`static_variation`, text): For complete: the key of the variation everyone gets.

**Outputs**

- `data` (object): The response from DevCycle.

**Example output**

```json
{
  "data": {
    "_id": "example",
    "_project": "example",
    "configurations": [
      {
        "_environment": "example",
        "_feature": "example",
        "hasStaticConfig": true,
        "startedAt": "example",
        "status": "example",
        "targets": [
          {}
        ],
        "updatedAt": "example"
      }
    ],
    "controlVariation": "example",
    "createdAt": "example",
    "description": "example",
    "key": "example",
    "name": "example",
    "source": "example",
    "staticVariation": "example",
    "status": "example",
    "tags": [
      "example"
    ],
    "type": "example",
    "updatedAt": "example",
    "variables": [
      {
        "_feature": "example",
        "_id": "example",
        "_project": "example",
        "createdAt": "example",
        "description": "example",
        "key": "example",
        "name": "example",
        "persistent": true,
        "source": "example",
        "status": "example",
        "tags": [
          "example"
        ],
        "type": "example",
        "updatedAt": "example"
      }
    ],
    "variations": [
      {
        "_id": "example",
        "key": "example",
        "name": "example",
        "variables": {}
      }
    ]
  }
}
```

### Update variable

Rename a variable or change its description or tags.

**Inputs**

- Project (`project`, text, required): The project.
- Variable (`variable`, text, required): The variable.
- Name (`name`, text): The display name, up to 100 characters.
- Description (`description`, text): A description, up to 1000 characters.
- Tags (`tags`, list): Tags to organize it on the dashboard.

**Outputs**

- `data` (object): The response from DevCycle.

**Example output**

```json
{
  "data": {
    "_feature": "example",
    "_id": "example",
    "_project": "example",
    "createdAt": "example",
    "description": "example",
    "key": "example",
    "name": "example",
    "persistent": true,
    "source": "example",
    "status": "example",
    "tags": [
      "example"
    ],
    "type": "example",
    "updatedAt": "example"
  }
}
```
