# Get a connection’s settings

**GET** `/api/connections/{id}/settings`

Returns a connection’s saved values that aren’t secret, and which secrets are saved.

Needs [an API token](https://docs.gorunner.io/api/authentication#scopes) with the **Read** permission for connections (`connection:read`).

## Parameters

### Path

- `id` · Required · UUID: The connection’s ID.

## Who sees the values

Only a token that may also change the connection, with the **Write** permission for connections. Others get `{"fields": {}, "savedSecrets": []}`.

A secret’s value is never answered, masked or not, and neither is an address with a password in it. The read is recorded in the audit log.

## Responses

- 200 OK

  The values and the saved secrets’ names.

- 400 `VALIDATION_ERROR`

  `id` isn’t a UUID.

- 403 `FORBIDDEN`

  The token lacks the **Read** permission for connections.

- 403 `MANAGED_CONNECTION`

  The partner manages this connection through its own API, so it can’t be changed here.

- 404 `NOT_FOUND`

  No connection with this ID in the token’s workspace.

- 500 `INTERNAL_ERROR`

  The connection couldn’t be read. Try again.

Any call can also answer: [`401 UNAUTHORIZED`](https://docs.gorunner.io/errors#UNAUTHORIZED) · [`401 TOKEN_ENDED`](https://docs.gorunner.io/errors#TOKEN_ENDED) · [`403 TOKEN_SURFACE_OFF`](https://docs.gorunner.io/errors#TOKEN_SURFACE_OFF) · [`403 FEATURE_OFF`](https://docs.gorunner.io/errors#FEATURE_OFF) · [`403 EMBED_NOT_ALLOWED`](https://docs.gorunner.io/errors#EMBED_NOT_ALLOWED) · [`403 EMBED_NOT_AVAILABLE`](https://docs.gorunner.io/errors#EMBED_NOT_AVAILABLE) · [`403 ACCOUNT_SUSPENDED`](https://docs.gorunner.io/errors#ACCOUNT_SUSPENDED) · [`429 RATE_LIMITED`](https://docs.gorunner.io/errors#RATE_LIMITED) · [`503 BUSY`](https://docs.gorunner.io/errors#BUSY) · [`503 PAUSED`](https://docs.gorunner.io/errors#PAUSED) · [`503 SERVICE_UNAVAILABLE`](https://docs.gorunner.io/errors#SERVICE_UNAVAILABLE). See [Errors](https://docs.gorunner.io/api/errors#by-status).

Request

**curl**

```bash
GORUNNER="https://api.gorunner.io"
GORUNNER_TOKEN="grt_…"  # needs Read for connections
CONNECTION_ID="your-connection-id"

curl "$GORUNNER/api/connections/$CONNECTION_ID/settings" \
  -H "Authorization: Bearer $GORUNNER_TOKEN"
```

**JavaScript**

```js
const GORUNNER = "https://api.gorunner.io";
const TOKEN = process.env.GORUNNER_TOKEN;
const CONNECTION_ID = process.env.CONNECTION_ID;

const res = await fetch(
  `${GORUNNER}/api/connections/` +
    `${CONNECTION_ID}/settings`,
  {
    headers: { Authorization: `Bearer ${TOKEN}` },
  },
);
const { data } = await res.json();
```

**Python**

```python
import os, requests

GORUNNER = "https://api.gorunner.io"
TOKEN = os.environ["GORUNNER_TOKEN"]
CONNECTION_ID = os.environ["CONNECTION_ID"]

res = requests.get(
    f"{GORUNNER}/api/connections/{CONNECTION_ID}/"
    f"settings",
    headers={"Authorization": f"Bearer {TOKEN}"},
)
data = res.json()["data"]
```

Response · 200 OK

```json
{
  "data": {
    "fields": {
      "host": "smtp.office365.com",
      "port": "587",
      "email": "warehouse@bakery.example",
      "tls": true
    },
    "savedSecrets": [
      "password"
    ]
  }
}
```

**Every field**

It takes no body.

### Response · 200 OK

- `data` · object
  - `fields` · object: The stored values that are not secret, by field name.
  - `savedSecrets` · array of strings: The keys of the secrets saved (never their values).

Related: [Rename or update a connection](https://docs.gorunner.io/api/connections/update-connection) · [Get a connection](https://docs.gorunner.io/api/connections/get-connection)

Source: https://docs.gorunner.io/api/connections/get-connection-settings
