# Connect Ramp

Source: https://immiscible.fly.dev/docs/api/put-api-w-wid-ramp

`PUT /api/w/:wid/ramp`

Owners. A Ramp Developer API app's client credentials. A token is requested with exactly the scopes the options need, which checks them; then they are sealed.

| Field | Description |
|---|---|
| `clientId`, `clientSecret` | the app's client credentials |
| `environment` | `production` (default) or `sandbox` |
| `writeMemos` | write the receipt id and decision into each charge's memo (needs `memos:write`) |
| `lockOnFreeze` | lock an agent's Ramp cards when it is frozen (needs `cards:write` and `funds:write`) |

## Authentication

Session cookie. A signed-in person: the console's session cookie. Every state-changing request also carries the header `x-immiscible-csrf: 1`, and the member's role decides what it may do. Bearer tokens are ignored on these routes, so no machine credential can reach them.

## Path parameters

- `wid` (string, required): Workspace id

## Request

curl:

```bash
curl -X PUT "https://immiscible.fly.dev/api/w/$IMMISCIBLE_WORKSPACE/ramp" \
  -H "cookie: __Host-sid=$IMMISCIBLE_SESSION" \
  -H "x-immiscible-csrf: 1" \
  -H "content-type: application/json" \
  -d '{
    "clientId": "ramp_client_...",
    "clientSecret": "...",
    "writeMemos": true,
    "lockOnFreeze": true
  }'
```

Node:

```ts
const res = await fetch('https://immiscible.fly.dev/api/w/$IMMISCIBLE_WORKSPACE/ramp', {
  method: 'PUT',
  headers: {
    cookie: `__Host-sid=${process.env.IMMISCIBLE_SESSION}`,
    'x-immiscible-csrf': '1',
    'content-type': 'application/json',
  },
  body: JSON.stringify({
    clientId: 'ramp_client_...',
    clientSecret: '...',
    writeMemos: true,
    lockOnFreeze: true,
  }),
});
const data = await res.json();
console.log(res.status, data);
```

Python:

```python
import os
import requests

res = requests.put(
    "https://immiscible.fly.dev/api/w/$IMMISCIBLE_WORKSPACE/ramp",
    headers={
        "cookie": f"__Host-sid={os.environ['IMMISCIBLE_SESSION']}",
        "x-immiscible-csrf": "1",
        "content-type": "application/json",
    },
    json={
        "clientId": "ramp_client_...",
        "clientSecret": "...",
        "writeMemos": True,
        "lockOnFreeze": True,
    },
)
print(res.status_code, res.json())
```
