> For the complete documentation index, see [llms.txt](https://ambit.gitbook.io/developer/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ambit.gitbook.io/developer/reference/pipeline.md).

# Funnels

## Retrieve all funnels

> Retrieve all funnels in a workspace.

```json
{"openapi":"3.0.0","info":{"title":"Ambit Core","version":"1.0"},"servers":[{"url":"/api/v1"}],"paths":{"/funnels":{"get":{"operationId":"FunnelsController_findAll","summary":"Retrieve all funnels","description":"Retrieve all funnels in a workspace.","parameters":[],"responses":{"200":{"description":"All funnels in a workspace.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FunnelDto"}}}}},"401":{"description":"The user is not authenticated."},"403":{"description":"The user does not have permission to perform this operation."}},"tags":["funnels"]}}},"components":{"schemas":{"FunnelDto":{"type":"object","properties":{"id":{"type":"string","description":"The funnel's ID."},"name":{"type":"string","description":"The funnel's name."},"automation_id":{"type":"string","description":"The funnel's automation ID."},"metadata":{"type":"object","description":"The funnel's metadata."},"created_at":{"format":"date-time","type":"string","description":"Timestamp of when the funnel was created."},"updated_at":{"format":"date-time","type":"string","description":"Timestamp of when the funnel was last updated."}},"required":["id","name","automation_id","metadata","created_at","updated_at"]}}}}
```

## Retrieve a single funnel

> Retrieve a funnel by its ID.

```json
{"openapi":"3.0.0","info":{"title":"Ambit Core","version":"1.0"},"servers":[{"url":"/api/v1"}],"paths":{"/funnels/{funnelId}":{"get":{"operationId":"FunnelsController_findOne","summary":"Retrieve a single funnel","description":"Retrieve a funnel by its ID.","parameters":[{"name":"funnelId","required":true,"in":"path","description":"The funnel's ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"A funnel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FunnelDto"}}}},"401":{"description":"The user is not authenticated."},"403":{"description":"The user does not have permission to perform this operation."}},"tags":["funnels"]}}},"components":{"schemas":{"FunnelDto":{"type":"object","properties":{"id":{"type":"string","description":"The funnel's ID."},"name":{"type":"string","description":"The funnel's name."},"automation_id":{"type":"string","description":"The funnel's automation ID."},"metadata":{"type":"object","description":"The funnel's metadata."},"created_at":{"format":"date-time","type":"string","description":"Timestamp of when the funnel was created."},"updated_at":{"format":"date-time","type":"string","description":"Timestamp of when the funnel was last updated."}},"required":["id","name","automation_id","metadata","created_at","updated_at"]}}}}
```

## Create a new funnel

> Create a new funnel.

```json
{"openapi":"3.0.0","info":{"title":"Ambit Core","version":"1.0"},"servers":[{"url":"/api/v1"}],"paths":{"/funnels":{"post":{"operationId":"FunnelsController_create","summary":"Create a new funnel","description":"Create a new funnel.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFunnelDto"}}}},"responses":{"201":{"description":"The funnel that was created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FunnelDto"}}}},"401":{"description":"The user is not authenticated."},"403":{"description":"The user does not have permission to perform this operation."}},"tags":["funnels"]}}},"components":{"schemas":{"CreateFunnelDto":{"type":"object","properties":{"name":{"type":"string","description":"The funnel's name."},"prompt":{"type":"string","description":"The prompt used to generate the funnel."},"theme":{"type":"object","description":"The funnel's theme."}},"required":["name","prompt","theme"]},"FunnelDto":{"type":"object","properties":{"id":{"type":"string","description":"The funnel's ID."},"name":{"type":"string","description":"The funnel's name."},"automation_id":{"type":"string","description":"The funnel's automation ID."},"metadata":{"type":"object","description":"The funnel's metadata."},"created_at":{"format":"date-time","type":"string","description":"Timestamp of when the funnel was created."},"updated_at":{"format":"date-time","type":"string","description":"Timestamp of when the funnel was last updated."}},"required":["id","name","automation_id","metadata","created_at","updated_at"]}}}}
```

## Update a single funnel

> Update a funnel by its ID.

```json
{"openapi":"3.0.0","info":{"title":"Ambit Core","version":"1.0"},"servers":[{"url":"/api/v1"}],"paths":{"/funnels/{funnelId}":{"patch":{"operationId":"FunnelsController_update","summary":"Update a single funnel","description":"Update a funnel by its ID.","parameters":[{"name":"funnelId","required":true,"in":"path","description":"The funnel's ID.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFunnelDto"}}}},"responses":{"200":{"description":"A funnel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FunnelDto"}}}},"401":{"description":"The user is not authenticated."},"403":{"description":"The user does not have permission to perform this operation."}},"tags":["funnels"]}}},"components":{"schemas":{"UpdateFunnelDto":{"type":"object","properties":{"name":{"type":"string","description":"The funnel's name."}},"required":["name"]},"FunnelDto":{"type":"object","properties":{"id":{"type":"string","description":"The funnel's ID."},"name":{"type":"string","description":"The funnel's name."},"automation_id":{"type":"string","description":"The funnel's automation ID."},"metadata":{"type":"object","description":"The funnel's metadata."},"created_at":{"format":"date-time","type":"string","description":"Timestamp of when the funnel was created."},"updated_at":{"format":"date-time","type":"string","description":"Timestamp of when the funnel was last updated."}},"required":["id","name","automation_id","metadata","created_at","updated_at"]}}}}
```

## Delete a funnel

> Delete a funnel.

```json
{"openapi":"3.0.0","info":{"title":"Ambit Core","version":"1.0"},"servers":[{"url":"/api/v1"}],"paths":{"/funnels/{funnelId}":{"delete":{"operationId":"FunnelsController_destroy","summary":"Delete a funnel","description":"Delete a funnel.","parameters":[{"name":"funnelId","required":true,"in":"path","description":"The funnel's ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"The funnel that was deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FunnelDto"}}}},"401":{"description":"The user is not authenticated."},"403":{"description":"The user does not have permission to perform this operation."}},"tags":["funnels"]}}},"components":{"schemas":{"FunnelDto":{"type":"object","properties":{"id":{"type":"string","description":"The funnel's ID."},"name":{"type":"string","description":"The funnel's name."},"automation_id":{"type":"string","description":"The funnel's automation ID."},"metadata":{"type":"object","description":"The funnel's metadata."},"created_at":{"format":"date-time","type":"string","description":"Timestamp of when the funnel was created."},"updated_at":{"format":"date-time","type":"string","description":"Timestamp of when the funnel was last updated."}},"required":["id","name","automation_id","metadata","created_at","updated_at"]}}}}
```
