---
title: "Setup GitHub connector"
method: POST
path: "/v1/connectors/github/setup"
tags: ["GitHub"]
---

# Setup GitHub connector

`POST /v1/connectors/github/setup`

Creates a GitHub connector account, instance, target, and initial mappings in one flow.

## Request body

- object
  - `installationId` integer, required
  - `connectorAccountId` string, typeid — Den TypeID with 'cac_' prefix and a 26-character base32 suffix.
  - `connectorInstanceName` string, required
  - `repositoryId` integer, required
  - `repositoryFullName` string, required
  - `branch` string, required
  - `ref` string, required
  - `mappings` object[]
    - `mappingKind` 'path' | 'api' | 'custom', required
    - `selector` string, required
    - `objectType` 'skill' | 'agent' | 'command' | 'tool' | 'mcp' | 'hook' | 'context' | 'custom', required
    - `pluginId` string, typeid, nullable — Den TypeID with 'plg_' prefix and a 26-character base32 suffix.
    - `autoAddToPlugin` boolean
    - `config` object

## Response `201`

GitHub connector setup created successfully.

- PluginArchGithubSetupResponse
  - `ok` true, required
  - `item` object, required
    - `connectorAccount` PluginArchConnectorAccount, required
      - `id` string, typeid, required — Den TypeID with 'cac_' prefix and a 26-character base32 suffix.
      - `organizationId` string, typeid, required — Den TypeID with 'org_' prefix and a 26-character base32 suffix.
      - `connectorType` 'github', required
      - `remoteId` string, required
      - `externalAccountRef` string, nullable, required
      - `displayName` string, required
      - `status` 'active' | 'inactive' | 'disconnected' | 'error', required
      - `createdByName` string, nullable
      - `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
      - `metadata` object
    - `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

## Other responses

- `400` — The GitHub setup request was invalid.
- `401` — The caller must be signed in to setup GitHub connectors.
- `403` — The caller lacks permission to setup GitHub connectors.

---

[API](https://skmtc.net/openworklabs/apis/den-api.md) · [All operations](https://skmtc.net/openworklabs/apis/den-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/openworklabs/den-api/versions/805150503452/schema)
