---
title: "Probe a URL for an OpenAPI surface"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.cloudraker.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Probe a URL for an OpenAPI surface

Path: CloudRaker Workspace API › Connections

`POST /spaces/{spaceId}/connections/discover`

Fetches `url` (and the conventional spec paths beside it) and lists the operations it declares, each labelled `read` or `write`. `domainMismatch` is true when the spec’s own base host differs from the host that was typed — confirm explicitly before importing (P5-D11). The URL is checked against the SSRF denylist before any fetch: HTTPS only, no loopback, private, link-local or `.local`/`.internal` hosts. Authorization: `space:contribute`. Returns `{ data: ConnectionDiscovery }`.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `spaceId` (`discoverConnection.path.spaceId`; string, required)

## Request body

_Required._

- `url` (`discoverConnection.url`; string, required)
  - minLength 1; example `"https://api.example.com/openapi.json"`

## Example request

```json
{
  "url": "https://api.example.com/openapi.json"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.cloudraker.com/spaces/<spaceId>/connections/discover' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "url": "https://api.example.com/openapi.json"
}
'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/spaces/<spaceId>/connections/discover';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({url: 'https://api.example.com/openapi.json'})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.cloudraker.com/spaces/<spaceId>/connections/discover"

payload = { "url": "https://api.example.com/openapi.json" }
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

The discovered surface.

#### Example

```json
{
  "data": {
    "baseUrl": "string",
    "sourceUrl": "string",
    "domainMismatch": true,
    "typedHost": "string",
    "operations": [
      {
        "id": "string",
        "name": "string",
        "description": "string",
        "method": "string",
        "path": "string",
        "access": "read"
      }
    ]
  }
}
```

- `data` (`discoverConnection.response.200.data`; object, required)
  - `baseUrl` (`discoverConnection.response.200.data.baseUrl`; string, required)
  - `sourceUrl` (`discoverConnection.response.200.data.sourceUrl`; string, required)
  - `domainMismatch` (`discoverConnection.response.200.data.domainMismatch`; boolean, required) — True when the spec’s own base host differs from the host the user typed — the UI must ask for explicit confirmation before importing (P5-D11).
  - `typedHost` (`discoverConnection.response.200.data.typedHost`; string, required)
  - `operations` (`discoverConnection.response.200.data.operations`; array<object>, required)
    - `id` (`discoverConnection.response.200.data.operations.id`; string, required)
    - `name` (`discoverConnection.response.200.data.operations.name`; string, required)
    - `description` (`discoverConnection.response.200.data.operations.description`; string, required)
    - `method` (`discoverConnection.response.200.data.operations.method`; string, required)
    - `path` (`discoverConnection.response.200.data.operations.path`; string, required)
    - `access` (`discoverConnection.response.200.data.operations.access`; string, required)
      - one of `"read"`, `"write"`


Source: https://docs.cloudraker.com/workspace/api/connections/discover-connection/index.md
