# Collections

{% openapi src="/files/DFxnj85ZsASPYXzkPAko" path="/api/v3/collections" method="get" %}
[UshahidiV3.json](https://content.gitbook.com/content/tXIYKGMTeHub5C8O9fER/blobs/TC8KXqdBoVrA1ZGmo9Kk/UshahidiV3.json)
{% endopenapi %}

## add collection

<mark style="color:green;">`POST`</mark> `https://ushahididocs.api.ushahidi.io/api/v3/collections`

#### Request Body

| Name          | Type    | Description                                             |
| ------------- | ------- | ------------------------------------------------------- |
| user\_id      | String  | The user identifier                                     |
| view          | String  | Type of view e.g. "list"                                |
| description   | String  | Collection description                                  |
| name          | String  | The name of collection                                  |
| view\_options | String  | View Option                                             |
| role          | String  | Role                                                    |
| featured      | Boolean | Set True to feature collection and False for unfeatured |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "id": 11,
    "url": null,
    "user": {
        "id": 2,
        "url": "http://localhost:8000/api/v3/users/2"
    },
    "name": "Test collection",
    "description": "",
    "view": "list",
    "view_options": null,
    "role": null,
    "featured": false,
    "created": "2022-11-01T08:13:25+00:00",
    "updated": null,
    "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
    ]
}
```

{% endtab %}
{% endtabs %}

## edit collection

<mark style="color:orange;">`PUT`</mark> `https://ushahididocs.api.ushahidi.io/api/v3/collections/3`

#### Request Body

| Name          | Type    | Description                                             |
| ------------- | ------- | ------------------------------------------------------- |
| user\_id      | String  | The user identifier                                     |
| view          | String  | Type of view e.g. "list"                                |
| description   | String  | Collection description                                  |
| name          | String  | The name of collection                                  |
| view\_options | String  | View Option                                             |
| role          | String  | Role                                                    |
| featured      | Boolean | Set True to feature collection and False for unfeatured |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "id": 11,
    "url": null,
    "user": {
        "id": 2,
        "url": "http://localhost:8000/api/v3/users/2"
    },
    "name": "Test collection",
    "description": "",
    "view": "list",
    "view_options": null,
    "role": null,
    "featured": false,
    "created": "2022-11-01T08:13:25+00:00",
    "updated": null,
    "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
    ]
}
```

{% endtab %}
{% endtabs %}

{% openapi src="/files/DFxnj85ZsASPYXzkPAko" path="/api/v3/collections/1" method="get" %}
[UshahidiV3.json](https://content.gitbook.com/content/tXIYKGMTeHub5C8O9fER/blobs/TC8KXqdBoVrA1ZGmo9Kk/UshahidiV3.json)
{% endopenapi %}

{% openapi src="/files/DFxnj85ZsASPYXzkPAko" path="/api/v3/collections/3" method="delete" %}
[UshahidiV3.json](https://content.gitbook.com/content/tXIYKGMTeHub5C8O9fER/blobs/TC8KXqdBoVrA1ZGmo9Kk/UshahidiV3.json)
{% endopenapi %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ushahidi.com/v3-ushahidi-platform-rest-api-documentation/v3/collections.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
