> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/developer/rest-api/vision-events/create-a-use-case.md).

# Create a Use Case

Create a new use case in your workspace. Use cases help you organize vision events by deployment context (e.g., "Manufacturing Line 1", "Warehouse Inventory").

**Required scope:** `vision-events:manage`

{% openapi src="/files/XCSsl1XUH9tiFJObaN6D" path="/vision-events/use-cases" method="post" %}
[openapi.yaml](https://1284666567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe5GEiPeDoFksvZv1vH3A%2Fuploads%2Fgit-blob-dfdc1702ad3d1a62ad0a661e9609f6bbe2fc8d4c%2Fopenapi.yaml?alt=media)
{% endopenapi %}

### Request Body Parameters

* **`name`** (string, required): A name for the use case. Must be between 1 and 256 characters. The name is trimmed of leading/trailing whitespace and must be unique within the workspace.

### Example Request

```bash
curl -X POST "https://api.roboflow.com/vision-events/use-cases" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Manufacturing Line 1"
  }'
```

### Example Response

{% tabs %}
{% tab title="201" %}

```json
{
  "id": "a1b3c8e1",
  "name": "Manufacturing Line 1"
}
```

{% endtab %}

{% tab title="400" %}

```json
{
  "error": "A solution with this name already exists"
}
```

{% endtab %}

{% tab title="403" %}

```json
{
  "error": "Insufficient permissions for this resource."
}
```

{% endtab %}
{% endtabs %}

### Notes

* New use cases are created with an `active` status by default.
* Use case names must be unique within a workspace. Attempting to create a use case with the same name as an existing one will return a `400` error.
* After creating a use case, you can reference its `id` as the `useCaseId` when [creating vision events](/developer/rest-api/vision-events/create-a-vision-event.md).
