# List integrations

List integration options your application can offer its represented users.

`GET https://api.smallworld.sh/api/v1/integrations`

## Request examples

### curl

```curl
curl --fail-with-body -X GET 'https://api.smallworld.sh/api/v1/integrations' \
  -H "Authorization: Bearer $SMALLWORLD_API_KEY"
```

### typescript

```typescript
const response = await fetch("https://api.smallworld.sh/api/v1/integrations", {
  method: "GET",
  headers: { Authorization: `Bearer ${apiKey}` },
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
const result = await response.json();
```

### python

```python
response = requests.get(
    "https://api.smallworld.sh/api/v1/integrations",
    headers={"Authorization": f"Bearer {api_key}"},
    timeout=30,
)
response.raise_for_status()
result = response.json()
```

## Responses

Returns items, without a pagination cursor. Each integration has key, name, description, authScheme (oauth2, api_key, or none), enabled, credentialFields, and nullable credentialInstructions. Credential fields include name, label, description, secret, nullable pattern, and maxLength. credentialInstructions contains text and a nullable url.

### 200

Returns items, without a pagination cursor. Each integration has key, name, description, authScheme (oauth2, api_key, or none), enabled, credentialFields, and nullable credentialInstructions. Credential fields include name, label, description, secret, nullable pattern, and maxLength. credentialInstructions contains text and a nullable url.

```json
{
  "items": [
    {
      "key": "github",
      "name": "GitHub",
      "description": "Work with repositories, issues, and pull requests using each user's own GitHub account.",
      "authScheme": "api_key",
      "enabled": true,
      "credentialFields": [
        {
          "name": "token",
          "label": "Personal access token",
          "description": "A fine-grained token (github_pat_…) or a classic token (ghp_…). Smallworld stores it encrypted and only sends it to GitHub.",
          "secret": true,
          "pattern": "^(?:ghp_|github_pat_)[A-Za-z0-9_]{20,}$",
          "maxLength": 512
        }
      ],
      "credentialInstructions": {
        "text": "Create a personal access token in your GitHub settings. A fine-grained token can be limited to selected repositories; a classic token with the repo, read:org, and read:user scopes works across your organizations.",
        "url": "https://github.com/settings/personal-access-tokens/new"
      }
    }
  ]
}
```

### 400

invalid_request: A parameter is invalid; the message names the problem. Unknown query parameters are rejected.

#### invalid_request

A parameter is invalid; the message names the problem. Unknown query parameters are rejected.

```json
{
  "statusCode": 400,
  "code": "invalid_request",
  "message": "Unknown query parameter: color"
}
```

### 401

authentication_required: The Authorization header is missing or empty. invalid_api_key: The API key is invalid or revoked, or the header doesn't use the Bearer scheme.

#### authentication_required

The Authorization header is missing or empty.

```json
{
  "statusCode": 401,
  "code": "authentication_required",
  "message": "Authentication is required"
}
```

#### invalid_api_key

The API key is invalid or revoked, or the header doesn't use the Bearer scheme.

```json
{
  "statusCode": 401,
  "code": "invalid_api_key",
  "message": "The API key is invalid or revoked"
}
```

### 403

ip_not_allowed: The request came from an address outside the workspace's IP allowlist.

#### ip_not_allowed

The request came from an address outside the workspace's IP allowlist.

```json
{
  "statusCode": 403,
  "code": "ip_not_allowed",
  "message": "The source IP address is not allowed by this account's security settings"
}
```

### 500

internal_error: An unexpected server error.

#### internal_error

An unexpected server error.

```json
{
  "statusCode": 500,
  "code": "internal_error",
  "message": "Internal server error"
}
```

## Notes

- Use the returned authScheme and fields instead of assuming a fixed provider flow. GitHub, for example, can use OAuth or a personal access token depending on workspace setup.

- Disabled integrations need setup and activation before users can connect. Use the configuration endpoints or dashboard. Built-in integrations use none, have no per-user credentials, and reject connection endpoints.

- This lists connection options, including configured MCP servers. Custom integrations are managed in the dashboard.
