# Extensions

> Outbound requests made through an extension's connections, with the credential attached server-side.

Part of the [Prosaic API reference](https://developer.prosaic.works/docs/api.md). Base URL: `https://app.prosaic.works/api/public/v1`. Authenticate with `Authorization: Bearer <API key or access token>`.

## Make an outbound request through an extension connection

`POST /api/public/v1/extensions/{extensionId}/http`

SDK: `prosaic.extensions.request(extensionId, params)`

Performs one guarded HTTP request to a third party on behalf of an
extension. The credential for the named connection is attached
server-side — the caller never supplies or receives it.

Requires a token minted for the extension named in the path. API keys
and ordinary user tokens are rejected.

Requires an extension-scoped token whose ext_id matches extensionId. Ordinary API keys and user OAuth tokens cannot call this endpoint. The embedded status/ok describe the upstream response, which can fail inside HTTP 200.

### Path parameters

- `extensionId` (string, required)

### Request body

Content type: `application/json`

- `connection` (string, required)
- `path` (string, required)
- `method` (string)
- `headers` (object)
- `body` (any)
- `timeoutMs` (number)
- `entityId` (string)

### Responses

- `200`: Successful response
  - `status` (number, required)
  - `ok` (boolean, required)
  - `headers` (object, required)
  - `body` (any, required)
- `403`: The token is not for this extension, or the host is not allowed
- `409`: The connection is not connected

### Example (Node SDK)

```ts
const result = await prosaic.extensions.request(extensionId, {
  connection: 'string',
  path: 'string',
});
```

### Example (curl)

```bash
curl -X POST https://app.prosaic.works/api/public/v1/extensions/$EXTENSION_ID/http \
  -H "Authorization: Bearer $PROSAIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "connection": "string",
    "path": "string"
  }'
```