# Make an agent act as the shared Everruns GitHub App

Source: <https://everruns.com/docs/api/operations/use_agent_everruns_app/>

[Docs](https://everruns.com/docs/)/[API reference](https://everruns.com/docs/api/)/[Agents & authoring](https://everruns.com/docs/api/groups/agents-authoring/)/Make an agent act as the shared Everruns GitHub App

# Make an agent act as the shared Everruns GitHub App

Preview

Make an agent act on GitHub as the shared Everruns App, through one installation an org admin linked in Settings > Organization. Only for an agent without a GitHub App of its own; disconnect that first.

Public APIEverruns Cloud and self-hosted Platform

POST`/v1/agents/{agent_id}/github/everruns-app`

See [authentication](https://everruns.com/docs/sre/runbooks/authentication/) for credentials and permissions.

## Parameters

### Path Parameters

**agent_id**

required

string

Prefixed public identifier

## Request Bodyrequired

Media typeapplication/json

Which org link to act through.

object

**connection_id**

required

Connection id of one of the org’s linked installations, from the agent’s GitHub status (`everruns_app_installations`).

string format: uuid

### Example generated

```json
{
  "connection_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}
```

## Responses

200Success

### 200

Success

Media typeapplication/json

GitHub as seen from an agent’s page.

object

**account**

GitHub account the App is installed on.

string | null

**app_created**

required

The App exists. Without `connected` it was never installed, or its installation was removed.

boolean

**app_settings_url**

The App’s settings page on GitHub, where its logo is uploaded (GitHub has no API for that). `None` when the owner’s account kind is not known, since user and organization Apps live at different paths.

string | null

**app_slug**

string | null

**app_url**

string | null

**bot_login**

The login GitHub shows for the agent, e.g. `pr-summarizer[bot]`, or the shared App’s (`everruns[bot]`) when the agent chose it and the deployment names its slug; `None` otherwise.

string | null

**connected**

required

An installation is bound, so tools and triggers work: the agent’s own App’s, or a shared Everruns App installation the agent chose.

boolean

**everruns_app_installations**

required

Shared Everruns App installations an org admin linked, which this agent can choose instead of an App of its own (D3). Empty when none is linked or the deployment has no shared App.

Array\<object>

A shared Everruns App installation the org links, as an agent can choose it.

object

**account**

required

GitHub account the installation is on.

string

**account_type**

GitHub’s account type: `User` or `Organization`, when known.

string | null

**connection_id**

required

The org link’s connection id; pass it to choose this installation.

string format: uuid

**repository_selection**

`all` or `selected`, when known.

string | null

**identity_id**

The agent’s identity, once it has one; disconnect goes through it.

string | null

**kind**

Which GitHub identity the agent acts as: `agent_app` (its own App) or `everruns_app` (the shared Everruns App). `None` before either exists.

string | null

**missing_permissions**

required

Permissions new Apps request that this installation lacks (`name:level`), e.g. `actions:read` for CI triggers on an App created before them. Empty when not connected.

Array\<string>

**repository_selection**

`all` or `selected`.

string | null

**suggested_owners**

required

GitHub accounts this organization already reached, as candidates for `owner_org` when creating the App: installation accounts of its GitHub connections and owners of its other agents’ Apps. Organizations first, then users, then accounts of unknown kind; by login within each.

Array\<object>

A GitHub account a new App could be created in.

object

**kind**

required

What kind of GitHub account a login is.

string

Allowed values: organization user unknown

**login**

required

string

**view_url**

The agent’s GitHub page in the console, so a caller can link to it. Absolute in responses; built as a relative path here because the console’s address is known only where links are decorated.

string | null

### Example

```json
{
  "bot_login": "pr-summarizer[bot]",
  "kind": "agent_app",
  "repository_selection": "selected",
  "suggested_owners": [
    {
      "kind": "organization"
    }
  ],
  "view_url": "https://app.everruns.com/agents/agent_01933b5a000070008000000000000001/github"
}
```

404Agent or linked installation not found

### 404

Agent or linked installation not found

409The agent has a GitHub App of its own

### 409

The agent has a GitHub App of its own

503The shared Everruns App is not configured

### 503

The shared Everruns App is not configured

FetchcURL

Request

```js
const url = 'https://app.everruns.com/api/v1/agents/example/github/everruns-app';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"connection_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}'
};


try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

Request

```sh
curl --request POST \
  --url https://app.everruns.com/api/v1/agents/example/github/everruns-app \
  --header 'Content-Type: application/json' \
  --data '{ "connection_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'
```

Additional language examples require JavaScript. The default request example is available above.

200404409503

200 · Success

```json
{
  "app_created": true,
  "bot_login": "pr-summarizer[bot]",
  "connected": true,
  "everruns_app_installations": [
    {
      "account": "string",
      "connection_id": "string"
    }
  ],
  "kind": "agent_app",
  "missing_permissions": [
    "string"
  ],
  "repository_selection": "selected",
  "suggested_owners": [
    {
      "kind": "organization",
      "login": "string"
    }
  ],
  "view_url": "https://app.everruns.com/agents/agent_01933b5a000070008000000000000001/github"
}
```

404 · Agent or linked installation not found

No response body example is declared for this status.

409 · The agent has a GitHub App of its own

No response body example is declared for this status.

503 · The shared Everruns App is not configured

No response body example is declared for this status.

## Matching endpoints