---
title: "Apply GitHub discovery selection"
method: POST
path: "/v1/connector-instances/{connectorInstanceId}/discovery/apply"
tags: ["GitHub"]
---

# Apply GitHub discovery selection

`POST /v1/connector-instances/{connectorInstanceId}/discovery/apply`

Creates OpenWork plugins and connector mappings from selected discovery candidates.

## Path parameters

- `connectorInstanceId` string, typeid, required

## Request body

- object
  - `autoImportNewPlugins` boolean
  - `selectedKeys` string[], required

## Response `200`

GitHub discovery selection applied successfully.

- PluginArchGithubDiscoveryApplyResponse
  - `ok` true, required
  - `item` object, required
    - `autoImportNewPlugins` boolean, required
    - `createdMarketplace` PluginArchMarketplace
      - `id` string, typeid, required — Den TypeID with 'mkt_' prefix and a 26-character base32 suffix.
      - `organizationId` string, typeid, required — Den TypeID with 'org_' prefix and a 26-character base32 suffix.
      - `name` string, required
      - `description` string, nullable, required
      - `logoUrl` string, nullable, required
      - `status` 'active' | 'inactive' | 'deleted' | 'archived', required
      - `createdByOrgMembershipId` string, typeid, required — Den TypeID with 'om_' prefix and a 26-character base32 suffix.
      - `createdAt` string, date-time, required
      - `updatedAt` string, date-time, required
      - `deletedAt` string, date-time, nullable, required
      - `pluginCount` integer
    - `connectorInstance` PluginArchConnectorInstance, required
      - `id` string, typeid, required — Den TypeID with 'cin_' prefix and a 26-character base32 suffix.
      - `organizationId` string, typeid, required — Den TypeID with 'org_' prefix and a 26-character base32 suffix.
      - `connectorAccountId` string, typeid, required — Den TypeID with 'cac_' prefix and a 26-character base32 suffix.
      - `connectorType` 'github', required
      - `remoteId` string, nullable, required
      - `name` string, required
      - `status` 'active' | 'disabled' | 'archived' | 'error', required
      - `instanceConfigJson` object, nullable, required
      - `lastSyncedAt` string, date-time, nullable, required
      - `lastSyncStatus` 'pending' | 'queued' | 'running' | 'completed' | 'failed' | 'partial' | 'ignored', nullable, required
      - `lastSyncCursor` string, nullable, required
      - `createdByOrgMembershipId` string, typeid, required — Den TypeID with 'om_' prefix and a 26-character base32 suffix.
      - `createdAt` string, date-time, required
      - `updatedAt` string, date-time, required
    - `connectorTarget` PluginArchConnectorTarget, required
      - `id` string, typeid, required — Den TypeID with 'ctg_' prefix and a 26-character base32 suffix.
      - `connectorInstanceId` string, typeid, required — Den TypeID with 'cin_' prefix and a 26-character base32 suffix.
      - `connectorType` 'github', required
      - `remoteId` string, required
      - `targetKind` 'repository_branch', required
      - `externalTargetRef` string, nullable, required
      - `targetConfigJson` object, required
      - `createdAt` string, date-time, required
      - `updatedAt` string, date-time, required
    - `createdPlugins` PluginArchPlugin[], required
      - `id` string, typeid, required — Den TypeID with 'plg_' prefix and a 26-character base32 suffix.
      - `organizationId` string, typeid, required — Den TypeID with 'org_' prefix and a 26-character base32 suffix.
      - `name` string, required
      - `description` string, nullable, required
      - `sourceRepositoryUrl` string, nullable, required
      - `sourceFormat` 'agent-plugin' | 'openwork-builtin' | 'openwork-extension-manifest' | 'claude-plugin' | 'opencode-plugin' | 'mcp-directory' | 'manual', nullable, required
      - `sourceSchemaVersion` string, nullable, required
      - `status` 'active' | 'inactive' | 'deleted' | 'archived', required
      - `createdByOrgMembershipId` string, typeid, required — Den TypeID with 'om_' prefix and a 26-character base32 suffix.
      - `createdAt` string, date-time, required
      - `updatedAt` string, date-time, required
      - `deletedAt` string, date-time, nullable, required
      - `memberCount` integer
      - `marketplaces` object[]
        - `id` string, typeid, required — Den TypeID with 'mkt_' prefix and a 26-character base32 suffix.
        - `name` string, required
      - `extension` PluginArchExtensionProjection
        - `id` string, typeid, required — Den TypeID with 'plg_' prefix and a 26-character base32 suffix.
        - `name` string, required
        - `description` string, nullable, required
        - `sourceFormat` 'agent-plugin' | 'openwork-builtin' | 'openwork-extension-manifest' | 'claude-plugin' | 'opencode-plugin' | 'mcp-directory' | 'manual', required
        - `manifest` OpenWorkExtensionManifest, required
          - `schemaVersion` 1, required
          - `id` string, required
          - `name` string, required
          - `description` string, required
          - `source` object, required
            - `format` 'agent-plugin' | 'openwork-builtin' | 'openwork-extension-manifest' | 'claude-plugin' | 'opencode-plugin' | 'mcp-directory' | 'manual', required
            - `trusted` boolean, required
            - `origin` 'builtin' | 'den' | 'workspace' | 'local'
            - `reference` string
          - `resources` object[], required
          - `contributions` object[]
          - `setup` object
          - `lifecycle` object
    - `createdMappings` PluginArchConnectorMapping[], required
      - `id` string, typeid, required — Den TypeID with 'cmp_' prefix and a 26-character base32 suffix.
      - `connectorInstanceId` string, typeid, required — Den TypeID with 'cin_' prefix and a 26-character base32 suffix.
      - `connectorTargetId` string, typeid, required — Den TypeID with 'ctg_' prefix and a 26-character base32 suffix.
      - `connectorType` 'github', required
      - `remoteId` string, nullable, required
      - `mappingKind` 'path' | 'api' | 'custom', required
      - `selector` string, required
      - `objectType` 'skill' | 'agent' | 'command' | 'tool' | 'mcp' | 'hook' | 'context' | 'custom' | 'script' | 'workflow' | 'app', required
      - `pluginId` string, typeid, nullable, required — Den TypeID with 'plg_' prefix and a 26-character base32 suffix.
      - `autoAddToPlugin` boolean, required
      - `mappingConfigJson` object, nullable, required
      - `createdAt` string, date-time, required
      - `updatedAt` string, date-time, required
    - `materializedConfigObjects` PluginArchConfigObject[], required
      - `id` string, typeid, required — Den TypeID with 'cob_' prefix and a 26-character base32 suffix.
      - `organizationId` string, typeid, required — Den TypeID with 'org_' prefix and a 26-character base32 suffix.
      - `objectType` 'skill' | 'agent' | 'command' | 'tool' | 'mcp' | 'hook' | 'context' | 'custom' | 'script' | 'workflow' | 'app', required
      - `sourceMode` 'cloud' | 'import' | 'connector', required
      - `title` string, required
      - `description` string, nullable, required
      - `searchText` string, nullable, required
      - `currentFileName` string, nullable, required
      - `currentFileExtension` string, nullable, required
      - `currentRelativePath` string, nullable, required
      - `status` 'active' | 'inactive' | 'deleted' | 'archived' | 'ingestion_error', required
      - `createdByOrgMembershipId` string, typeid, required — Den TypeID with 'om_' prefix and a 26-character base32 suffix.
      - `connectorInstanceId` string, typeid, nullable, required — Den TypeID with 'cin_' prefix and a 26-character base32 suffix.
      - `createdAt` string, date-time, required
      - `updatedAt` string, date-time, required
      - `deletedAt` string, date-time, nullable, required
      - `latestVersion` PluginArchConfigObjectVersion, required
        - `id` string, typeid, required — Den TypeID with 'cov_' prefix and a 26-character base32 suffix.
        - `configObjectId` string, typeid, required — Den TypeID with 'cob_' prefix and a 26-character base32 suffix.
        - `schemaVersion` string, nullable, required
        - `normalizedPayloadJson` object, nullable, required
        - `rawSourceText` string, nullable, required
        - `createdVia` 'cloud' | 'import' | 'connector' | 'system', required
        - `createdByOrgMembershipId` string, typeid, nullable, required — Den TypeID with 'om_' prefix and a 26-character base32 suffix.
        - `connectorSyncEventId` string, typeid, nullable, required — Den TypeID with 'cse_' prefix and a 26-character base32 suffix.
        - `sourceRevisionRef` string, nullable, required
        - `isDeletedVersion` boolean, required
        - `createdAt` string, date-time, required
    - `sourceRevisionRef` string, required

## Other responses

- `400` — The discovery apply request was invalid.
- `401` — The caller must be signed in to apply discovery selections.
- `403` — The caller lacks permission to edit this connector instance.
- `404` — The connector instance could not be found.

## Changes

- **2026-08-29** `fcbb34aa1702` — 2 warning, 2 info
  - added the new `agent-plugin` enum value to the `item/createdPlugins/items/extension/anyOf[#/components/schemas/PluginArchExtensionProjection]/manifest/anyOf[#/components/schemas/OpenWorkExtensionManifest]/source/format` response property for the response status `200`
  - added the new `agent-plugin` enum value to the `item/createdPlugins/items/extension/anyOf[#/components/schemas/PluginArchExtensionProjection]/sourceFormat` response property for the response status `200`
  - added the required property `item/createdPlugins/items/sourceFormat` to the response with the `200` status
  - added the required property `item/createdPlugins/items/sourceSchemaVersion` to the response with the `200` status
- **2026-08-20** `93df40e2efd5` — 2 warning, 27 info
  - added the new `workflow` enum value to the `item/createdMappings/items/objectType` response property for the response status `200`
  - added the new `workflow` enum value to the `item/materializedConfigObjects/items/objectType` response property for the response status `200`
  - removed the pattern `^cin_.*` from the `path` request parameter `connectorInstanceId`
  - the `item/connectorInstance/connectorAccountId` response's property pattern `^cac_.*` was removed for the status `200`
  - …25 more
- …earlier changes not shown

[Full history](https://skmtc.dev/openworklabs/apis/den-api/changes/v1/connector-instances/:connectorInstanceId/discovery/apply/post.md)

---

[API](https://skmtc.dev/openworklabs/apis/den-api.md) · [All operations](https://skmtc.dev/openworklabs/apis/den-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/openworklabs/den-api/revisions/27875723ff22/schema)
