Channels API

Archive and restore Loop channels via REST API. Supports hidden and read-only archive visibility modes.

The Channels API allows external systems to archive and restore Loop channels programmatically.

Archive / Restore Channel

Archive a channel or restore an archived channel.

Endpoint

POST /api/v1/integration/channels/{channelId}/archive

Path Parameters

ParameterTypeDescription
channelIdUUIDThe unique identifier of the channel

Request Body

{
  "action": "archive" | "restore",
  "visibility": "hidden" | "readonly"
}

Body Parameters

ParameterTypeRequiredDescription
actionstringYesEither "archive" to archive the channel or "restore" to restore it
visibilitystringNoArchive visibility mode. Only used when action is "archive". Defaults to "hidden"

Archive Visibility Modes

ModeBehavior
hiddenChannel is completely hidden from the sidebar. Users cannot access it.
readonlyChannel appears greyed out in the sidebar. Users can view existing content but cannot post new messages, reactions, or replies.

Example Request - Archive as Read-Only

curl -X POST https://your-domain.com/api/v1/integration/channels/123e4567-e89b-12d3-a456-426614174000/archive \
  -H "x-api-key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "archive",
    "visibility": "readonly"
  }'

Example Request - Archive as Hidden

curl -X POST https://your-domain.com/api/v1/integration/channels/123e4567-e89b-12d3-a456-426614174000/archive \
  -H "x-api-key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "archive",
    "visibility": "hidden"
  }'

Example Request - Restore Channel

curl -X POST https://your-domain.com/api/v1/integration/channels/123e4567-e89b-12d3-a456-426614174000/archive \
  -H "x-api-key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "restore"
  }'

Success Response

{
  "success": true,
  "message": "Channel archived successfully",
  "channel": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "name": "General Discussion",
    "slug": "general-discussion",
    "is_archived": true,
    "archive_visibility": "readonly"
  }
}

Error Responses

Invalid Channel ID (400)

{
  "error": {
    "code": "invalid_channel_id",
    "message": "Channel ID must be a valid UUID"
  }
}

Channel Not Found (404)

{
  "error": {
    "code": "channel_not_found",
    "message": "Channel with ID 123e4567-e89b-12d3-a456-426614174000 not found"
  }
}

Unauthorized (403)

{
  "error": {
    "code": "unauthorized",
    "message": "You do not have permission to modify this channel"
  }
}

Validation Error (400)

{
  "error": {
    "code": "validation_error",
    "message": "Invalid request body: action: Required"
  }
}

Use Cases

Archiving Inactive Channels

When a project completes or a channel becomes inactive, archive it as read-only to preserve history while preventing new activity:

curl -X POST .../archive \
  -d '{"action": "archive", "visibility": "readonly"}'

Hiding Sensitive Channels

For channels that should no longer be visible (e.g., deprecated projects, sensitive discussions):

curl -X POST .../archive \
  -d '{"action": "archive", "visibility": "hidden"}'

Reactivating a Channel

To restore a previously archived channel to full functionality:

curl -X POST .../archive \
  -d '{"action": "restore"}'

Restoring a channel:

  • Sets is_archived to false
  • Resets archive_visibility to hidden
  • Makes the channel fully functional again