Skip to content
This repository was archived by the owner on Mar 17, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions _data/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@
- rename
- roles
- setCustomFields
- setDefault
- setDescription
- setJoinCode
- setPurpose
Expand Down
1 change: 1 addition & 0 deletions contributing/documentation/documentation-map/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ Here you can also find what articles are incomplete and missing.
- rename
- roles
- setCustomFields
- setDefault
- setDescription
- setJoinCode
- setPurpose
Expand Down
1 change: 1 addition & 0 deletions developer-guides/rest-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ When calling a production Rocket.Chat server, ensure it is running via HTTPS and
| `/api/v1/channels.roles` | Gets the user's roles in the channel. | [Link](channels/roles/) |
| `/api/v1/channels.setCustomFields` | Sets a channel's custom fields. | [Link](channels/setcustomfields/) |
| `/api/v1/channels.setAnnouncement` | Sets a channel's announcement. | [Link](channels/setannouncement/) |
| `/api/v1/channels.setDefault` | Sets whether a channel is a default channel or not. | [Link](channels/setdefault/) |
| `/api/v1/channels.setDescription` | Sets a channel's description. | [Link](channels/setdescription/) |
| `/api/v1/channels.setJoinCode` | Sets the channel's code required to join it. | [Link](channels/setjoincode/) |
| `/api/v1/channels.setPurpose` | Sets a channel's description. | [Link](channels/setpurpose/) |
Expand Down
1 change: 1 addition & 0 deletions developer-guides/rest-api/channels/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
| `/api/v1/channels.rename` | Changes a channel's name. | [Link](rename/) |
| `/api/v1/channels.roles` | Gets the user's roles in the channel.| [Link](roles/) |
| `/api/v1/channels.setCustomFields` | Sets a channel's custom fields. | [Link](setcustomfields/) |
| `/api/v1/channels.setDefault` | Sets a channel's default status. | [Link](setdefault/) |
| `/api/v1/channels.setDescription` | Sets a channel's description. | [Link](setdescription/) |
| `/api/v1/channels.setJoinCode` | Sets the channel's code required to join it. | [Link](setjoincode/) |
| `/api/v1/channels.setPurpose` | Sets a channel's description. | [Link](setpurpose/) |
Expand Down
59 changes: 59 additions & 0 deletions developer-guides/rest-api/channels/setdefault/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Channel Set Default

Sets whether the channel is a default channel or not.

| URL | Requires Auth | HTTP Method |
| :--- | :--- | :--- |
| `/api/v1/channels.setDefault` | `yes` | `POST` |

## Payload

| Argument | Example | Required | Description |
| :--- | :--- | :--- | :--- |
| `roomId` | `ByehQjC44FwMeiLbX` | Required | The channel's id |
| `default` | `true` | Required | Boolean of whether the room is default or not. |

## Example Call

```bash
curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
-H "X-User-Id: aobEdbYhXfu5hkeqG" \
-H "Content-type: application/json" \
http://localhost:3000/api/v1/channels.setDefault \
-d '{ "roomId": "ByehQjC44FwMeiLbX", "default": true }'
```

## Example Result

```json
{
"channel": {
"_id": "ByehQjC44FwMeiLbX",
"name": "testing0",
"t": "c",
"msgs": 0,
"u": {
"_id": "aiPqNoGkjpNDiRx6d",
"username": "goose160"
},
"ts": "2017-01-05T18:02:50.754Z",
"ro": true,
"sysMes": true,
"_updatedAt": "2017-01-05T19:02:24.429Z",
"usernames": [
"goose160",
"graywolf336"
],
"joinCodeRequired": true,
"muted": [],
"default": true
},
"success": true
}
```

## Change Log

| Version | Description |
| :--- | :--- |
| 0.66.0 | Added |