# Manage your integrations’ keys and plugins

See the keys your integrations hold, fix a key’s caption, retire a key that should no longer work, and switch a registered plugin on or off for your organization.

Integrations · a play in 4 steps.

## The steps

1. See the keys, and fix a key’s caption — the secret and scopes never change. — [apiKeys](/reference/api-key/apiKeys/), [updateApiKey](/reference/api-key/updateApiKey/)
2. Retire a key for good — history remains readable. — [doomApiKey](/reference/api-key/doomApiKey/)
3. See the registered extensions available to your group. — [plugins](/reference/plugin/plugins/)
4. Switch a registered plugin on for the organization, and off again when it should stop running. — [createOrgPlugin](/reference/org-plugin/createOrgPlugin/), [deactivateOrgPlugin](/reference/org-plugin/deactivateOrgPlugin/)

## The calls

Every operation this use case runs, in the order it first appears, with the request and the response its reference page shows.

### apiKeys

[apiKeys](/reference/api-key/apiKeys/) — query · The api key list — each entry is an API key — a machine credential for integrations.

**Example request**

```graphql
query ExampleApiKeys($filter: FilterInput) {
  apiKeys(filter: $filter) {
    items {
      id
      sysId
      type
      caption
      status
      parentId
      rootId
      createdAt
      updatedAt
      revisionNum
      revision
      expiresAt
    }
    nextToken
    matchCount
  }
}
```

Variables:

```json
{
  "filter": {
    "clauses": [
      {
        "field": "caption",
        "op": "contains",
        "values": [
          "Blue"
        ]
      }
    ]
  }
}
```

**Example response**

```json
{
  "data": {
    "apiKeys": {
      "items": [
        {
          "id": "01900000-0000-7000-8000-37386ae00000",
          "sysId": "AK-EXMP-0000-000F",
          "type": "ApiKey",
          "caption": "Blue jeans",
          "status": "active",
          "parentId": "01900000-0000-7000-8000-065235280000",
          "rootId": "01900000-0000-7000-8000-a093dd800000",
          "createdAt": "2027-01-31T00:00:00.000Z",
          "updatedAt": "2027-01-31T00:00:00.000Z",
          "revisionNum": 1,
          "revision": "01900000-0000-7000-8000-b7960e180000",
          "expiresAt": "2027-01-31T00:00:00.000Z"
        }
      ],
      "nextToken": "<the cursor from the previous page>",
      "matchCount": 1
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": null,
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}
```

### updateApiKey

[updateApiKey](/reference/api-key/updateApiKey/) — mutation · Edit an API key’s facts (caption); the secret and scopes are immutable.

**Example request**

```graphql
mutation ExampleUpdateApiKey($id: ID!, $revision: ID!, $input: EditApiKeyInput!) {
  updateApiKey(id: $id, revision: $revision, input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    expiresAt
  }
}
```

Variables:

```json
{
  "id": "01900000-0000-7000-8000-37386ae00000",
  "revision": "01900000-0000-7000-8000-b7960e180000",
  "input": {
    "caption": "Blue jeans"
  }
}
```

Send it with the envelope naming the version: `"extensions": {"at": {"version": {"name":"genesis","number":0}}}`.

**Example response**

```json
{
  "data": {
    "updateApiKey": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "AK-EXMP-0000-000F",
      "type": "ApiKey",
      "caption": "Blue jeans",
      "status": "active",
      "parentId": "01900000-0000-7000-8000-065235280000",
      "rootId": "01900000-0000-7000-8000-a093dd800000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-b7960e180000",
      "expiresAt": "2027-01-31T00:00:00.000Z"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}
```

### doomApiKey

[doomApiKey](/reference/api-key/doomApiKey/) — mutation · Permanently retire an API key — a machine credential for integrations.

**Example request**

```graphql
mutation ExampleDoomApiKey($id: ID!, $revision: ID!, $reason: String) {
  doomApiKey(id: $id, revision: $revision, reason: $reason) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    expiresAt
  }
}
```

Variables:

```json
{
  "id": "01900000-0000-7000-8000-37386ae00000",
  "revision": "01900000-0000-7000-8000-b7960e180000",
  "reason": "Correcting a miscount."
}
```

Send it with the envelope naming the version: `"extensions": {"at": {"version": {"name":"genesis","number":0}}}`.

**Example response**

```json
{
  "data": {
    "doomApiKey": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "AK-EXMP-0000-000F",
      "type": "ApiKey",
      "caption": "Blue jeans",
      "status": "active",
      "parentId": "01900000-0000-7000-8000-065235280000",
      "rootId": "01900000-0000-7000-8000-a093dd800000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-b7960e180000",
      "expiresAt": "2027-01-31T00:00:00.000Z"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}
```

### plugins

[plugins](/reference/plugin/plugins/) — query · The plugin list — each entry is a plugin — a third-party extension registered for your group (it runs on the developer’s own systems).

**Example request**

```graphql
query ExamplePlugins($limit: Int) {
  plugins(limit: $limit) {
    items {
      id
      sysId
      type
      caption
      status
      parentId
      rootId
      createdAt
      updatedAt
      revisionNum
      revision
      developerName
      homepageUrl
      apiKeyId
    }
    nextToken
  }
}
```

Variables:

```json
{
  "limit": 1
}
```

**Example response**

```json
{
  "data": {
    "plugins": {
      "items": [
        {
          "id": "01900000-0000-7000-8000-37386ae00000",
          "sysId": "PN-EXMP-0000-000F",
          "type": "Plugin",
          "caption": "Blue jeans",
          "status": "active",
          "parentId": "01900000-0000-7000-8000-065235280000",
          "rootId": "01900000-0000-7000-8000-a093dd800000",
          "createdAt": "2027-01-31T00:00:00.000Z",
          "updatedAt": "2027-01-31T00:00:00.000Z",
          "revisionNum": 1,
          "revision": "01900000-0000-7000-8000-b7960e180000",
          "developerName": "Blue jeans",
          "homepageUrl": "https://example.com/hook",
          "apiKeyId": "01900000-0000-7000-8000-d64fbf430000"
        }
      ],
      "nextToken": "<the cursor from the previous page>"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": null,
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}
```

### createOrgPlugin

[createOrgPlugin](/reference/org-plugin/createOrgPlugin/) — mutation · Create a new per-organization plugin enablement — which registered extensions run at this organization at your organization.

**Example request**

```graphql
mutation ExampleCreateOrgPlugin($input: NewOrgPluginInput!) {
  createOrgPlugin(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    pluginId
    code
  }
}
```

Variables:

```json
{
  "input": {
    "caption": "Blue jeans",
    "organizationId": "01900000-0000-7000-8000-44b781470000",
    "pluginId": "01900000-0000-7000-8000-bf0997d70000"
  }
}
```

Send it with the envelope naming the version: `"extensions": {"at": {"version": {"name":"genesis","number":0}}}`.

**Example response**

```json
{
  "data": {
    "createOrgPlugin": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "EP-EXMP-0000-000F",
      "type": "OrgPlugin",
      "caption": "Blue jeans",
      "status": "active",
      "parentId": "01900000-0000-7000-8000-065235280000",
      "rootId": "01900000-0000-7000-8000-a093dd800000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-b7960e180000",
      "pluginId": "01900000-0000-7000-8000-bf0997d70000",
      "code": "BJ-001"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}
```

### deactivateOrgPlugin

[deactivateOrgPlugin](/reference/org-plugin/deactivateOrgPlugin/) — mutation · Deactivate a per-organization plugin enablement — which registered extensions run at this organization — it stops being usable but keeps its history and can be reactivated.

**Example request**

```graphql
mutation ExampleDeactivateOrgPlugin($id: ID!, $revision: ID!, $reason: String) {
  deactivateOrgPlugin(id: $id, revision: $revision, reason: $reason) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    pluginId
    code
  }
}
```

Variables:

```json
{
  "id": "01900000-0000-7000-8000-37386ae00000",
  "revision": "01900000-0000-7000-8000-b7960e180000",
  "reason": "Correcting a miscount."
}
```

Send it with the envelope naming the version: `"extensions": {"at": {"version": {"name":"genesis","number":0}}}`.

**Example response**

```json
{
  "data": {
    "deactivateOrgPlugin": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "EP-EXMP-0000-000F",
      "type": "OrgPlugin",
      "caption": "Blue jeans",
      "status": "active",
      "parentId": "01900000-0000-7000-8000-065235280000",
      "rootId": "01900000-0000-7000-8000-a093dd800000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-b7960e180000",
      "pluginId": "01900000-0000-7000-8000-bf0997d70000",
      "code": "BJ-001"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}
```
