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

# Search Deployments

> Search deployments by discovery metadata

Search deployments by description, summary, tags, capabilities, and use cases defined in `runtm.discovery.yaml`.

## Query Parameters

**q** `string` *required*

Search query (searches description, summary, tags, capabilities, use\_cases, and name)

**state** `string`

Filter by state: `queued`, `building`, `deploying`, `ready`, `failed`, `destroyed`

**template** `string`

Filter by template: `backend-service`, `static-site`, `web-app`

**limit** `integer` (default: 20)

Maximum results (1-100)

## Response

**results** `array`

List of matching deployments with relevance scores

**Search result object**

**deployment\_id** `string`

Deployment identifier

**name** `string`

Project name

**state** `string`

Current state

**match\_score** `number`

Relevance score (higher is better)

**discovery** `object`

Discovery metadata (description, summary, tags, etc.)

**total** `integer`

Total matching results

**query** `string`

The search query used

```bash cURL theme={null}
curl -X GET "https://app.runtm.com/api/v0/deployments/search?q=payment&state=ready" \
  -H "Authorization: Bearer runtm_xxx"
```

```python Python theme={null}
import requests

response = requests.get(
    "https://app.runtm.com/api/v0/deployments/search",
    headers={"Authorization": "Bearer runtm_xxx"},
    params={
        "q": "payment",
        "state": "ready",
        "template": "backend-service"
    }
)

data = response.json()
for result in data["results"]:
    print(f"{result['name']} (score: {result['match_score']})")
```

```javascript JavaScript theme={null}
const params = new URLSearchParams({
  q: "payment",
  state: "ready",
  template: "backend-service"
});

const response = await fetch(
  `https://app.runtm.com/api/v0/deployments/search?${params}`,
  {
    headers: {
      "Authorization": "Bearer runtm_xxx"
    }
  }
);

const data = await response.json();
data.results.forEach(result => {
  console.log(`${result.name} (score: ${result.match_score})`);
});
```

```json 200 theme={null}
{
  "results": [
    {
      "deployment_id": "dep_abc123xyz",
      "name": "stripe-webhook",
      "state": "ready",
      "url": "https://stripe-webhook-abc123.fly.dev",
      "template": "backend-service",
      "runtime": "python",
      "version": 2,
      "is_latest": true,
      "created_at": "2024-01-15T10:30:00Z",
      "match_score": 1.8,
      "discovery": {
        "description": "Stripe webhook handler that processes payment events in real-time.",
        "summary": "Real-time Stripe payment webhook processor",
        "tags": ["stripe", "webhook", "payments", "api"],
        "capabilities": [
          "Process Stripe webhook events",
          "Update order status in database"
        ]
      }
    }
  ],
  "total": 1,
  "query": "payment"
}
```

> [!NOTE]
>
> Search results are ranked by relevance. Exact tag matches score highest, followed by summary, description, capabilities, use cases, and name matches.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.