# Site channels

Manage the channels used as origins for questions and answers in your site ask data.

## The SiteChannel object

```json
{"openapi":"3.1.0","info":{"title":"GitBook API","version":"0.0.1-beta"},"components":{"schemas":{"SiteChannel":{"allOf":[{"$ref":"#/components/schemas/SiteChannelSetup"},{"type":"object","properties":{"object":{"type":"string","enum":["site-channel"]},"id":{"type":"string","description":"Unique identifier for the site channel."},"status":{"$ref":"#/components/schemas/SiteChannelStatus"},"role":{"$ref":"#/components/schemas/SiteChannelRole"},"answers":{"type":"integer","minimum":0,"description":"Number of answers linked to this channel."},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"urls":{"type":"object","properties":{"location":{"type":"string","format":"uri","description":"URL of the site channel in the API."}},"required":["location"]}},"required":["object","id","status","role","answers","createdAt","urls"]}]},"SiteChannelSetup":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["builtin:slack"]},"setupSettings":{"type":"object","additionalProperties":false,"properties":{"allowedChannels":{"description":"List of allowed Slack channel names or patterns. If empty, all channels are allowed.","type":"array","items":{"$ref":"#/components/schemas/GenericChannelPattern"}}}}},"required":["type","setupSettings"]},{"type":"object","properties":{"type":{"type":"string","enum":["builtin:github"]},"setupSettings":{"type":"object","additionalProperties":false,"properties":{"allowedRepositories":{"description":"List of allowed GitHub repository names or patterns. If empty, all repositories are allowed.","type":"array","items":{"$ref":"#/components/schemas/GitHubRepositoryPattern"}}}}},"required":["type","setupSettings"]},{"type":"object","properties":{"type":{"type":"string","enum":["builtin:discord"]},"setupSettings":{"type":"object","additionalProperties":false,"properties":{"allowedChannels":{"description":"List of allowed Discord channel names or patterns. If empty, all channels are allowed.","type":"array","items":{"$ref":"#/components/schemas/GenericChannelPattern"}}}}},"required":["type","setupSettings"]}]},"GenericChannelPattern":{"type":"string","description":"A generic channel name or pattern. For example, \"general\" or \"support-*\".","pattern":"^[a-zA-Z0-9_\\*-]+$"},"GitHubRepositoryPattern":{"type":"string","description":"A GitHub repository name or pattern in the format \"owner/repository\". For example, \"my-org/my-repo\" or \"my-org/*\" to allow all repositories under \"my-org\".","pattern":"^[a-zA-Z0-9._*-]+\\/[a-zA-Z0-9._*-]+$"},"SiteChannelStatus":{"type":"string","enum":["active","pending"]},"SiteChannelRole":{"type":"string","enum":["collaborator","support"]},"Timestamp":{"type":"string","format":"date-time"}}}}
```

## GET /orgs/{organizationId}/sites/{siteId}/channels

> List all site channels for a site

```json
{"openapi":"3.1.0","info":{"title":"GitBook API","version":"0.0.1-beta"},"tags":[{"name":"site-channels","description":"Manage the channels used as origins for questions and answers in your site ask data.\n\n{% openapi-schemas spec=\"gitbook\" schemas=\"SiteChannel\" grouped=\"false\" %}\n    The SiteChannel object\n{% endopenapi-schemas %}\n"}],"servers":[{"url":"{host}/v1","variables":{"host":{"default":"https://api.gitbook.com"}}}],"security":[{"user":[]}],"components":{"securitySchemes":{"user":{"type":"http","scheme":"bearer"}},"parameters":{"organizationId":{"name":"organizationId","in":"path","required":true,"description":"The unique id of the organization","schema":{"$ref":"#/components/schemas/EntityId"}},"siteId":{"name":"siteId","in":"path","required":true,"description":"The unique id of the site","schema":{"type":"string"}},"listPage":{"name":"page","in":"query","description":"Identifier of the page results to fetch.","schema":{"type":"string"}},"listLimit":{"name":"limit","in":"query","description":"The number of results per page","schema":{"type":"number","minimum":0,"maximum":1000}}},"schemas":{"EntityId":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","description":"A unique entity identifier"},"List":{"type":"object","properties":{"next":{"type":"object","properties":{"page":{"type":"string","description":"Unique identifier to query the next results page"}},"required":["page"]},"count":{"type":"number","description":"Total count of objects in the list"}}},"SiteChannel":{"allOf":[{"$ref":"#/components/schemas/SiteChannelSetup"},{"type":"object","properties":{"object":{"type":"string","enum":["site-channel"]},"id":{"type":"string","description":"Unique identifier for the site channel."},"status":{"$ref":"#/components/schemas/SiteChannelStatus"},"role":{"$ref":"#/components/schemas/SiteChannelRole"},"answers":{"type":"integer","minimum":0,"description":"Number of answers linked to this channel."},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"urls":{"type":"object","properties":{"location":{"type":"string","format":"uri","description":"URL of the site channel in the API."}},"required":["location"]}},"required":["object","id","status","role","answers","createdAt","urls"]}]},"SiteChannelSetup":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["builtin:slack"]},"setupSettings":{"type":"object","additionalProperties":false,"properties":{"allowedChannels":{"description":"List of allowed Slack channel names or patterns. If empty, all channels are allowed.","type":"array","items":{"$ref":"#/components/schemas/GenericChannelPattern"}}}}},"required":["type","setupSettings"]},{"type":"object","properties":{"type":{"type":"string","enum":["builtin:github"]},"setupSettings":{"type":"object","additionalProperties":false,"properties":{"allowedRepositories":{"description":"List of allowed GitHub repository names or patterns. If empty, all repositories are allowed.","type":"array","items":{"$ref":"#/components/schemas/GitHubRepositoryPattern"}}}}},"required":["type","setupSettings"]},{"type":"object","properties":{"type":{"type":"string","enum":["builtin:discord"]},"setupSettings":{"type":"object","additionalProperties":false,"properties":{"allowedChannels":{"description":"List of allowed Discord channel names or patterns. If empty, all channels are allowed.","type":"array","items":{"$ref":"#/components/schemas/GenericChannelPattern"}}}}},"required":["type","setupSettings"]}]},"GenericChannelPattern":{"type":"string","description":"A generic channel name or pattern. For example, \"general\" or \"support-*\".","pattern":"^[a-zA-Z0-9_\\*-]+$"},"GitHubRepositoryPattern":{"type":"string","description":"A GitHub repository name or pattern in the format \"owner/repository\". For example, \"my-org/my-repo\" or \"my-org/*\" to allow all repositories under \"my-org\".","pattern":"^[a-zA-Z0-9._*-]+\\/[a-zA-Z0-9._*-]+$"},"SiteChannelStatus":{"type":"string","enum":["active","pending"]},"SiteChannelRole":{"type":"string","enum":["collaborator","support"]},"Timestamp":{"type":"string","format":"date-time"}}},"paths":{"/orgs/{organizationId}/sites/{siteId}/channels":{"get":{"operationId":"listSiteChannels","summary":"List all site channels for a site","tags":["site-channels"],"parameters":[{"$ref":"#/components/parameters/organizationId"},{"$ref":"#/components/parameters/siteId"},{"$ref":"#/components/parameters/listPage"},{"$ref":"#/components/parameters/listLimit"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/List"},{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SiteChannel"}}}}]}}}}}}}}}
```

## POST /orgs/{organizationId}/sites/{siteId}/channels

> Create a site channel

```json
{"openapi":"3.1.0","info":{"title":"GitBook API","version":"0.0.1-beta"},"tags":[{"name":"site-channels","description":"Manage the channels used as origins for questions and answers in your site ask data.\n\n{% openapi-schemas spec=\"gitbook\" schemas=\"SiteChannel\" grouped=\"false\" %}\n    The SiteChannel object\n{% endopenapi-schemas %}\n"}],"servers":[{"url":"{host}/v1","variables":{"host":{"default":"https://api.gitbook.com"}}}],"security":[{"user":[]}],"components":{"securitySchemes":{"user":{"type":"http","scheme":"bearer"}},"parameters":{"organizationId":{"name":"organizationId","in":"path","required":true,"description":"The unique id of the organization","schema":{"$ref":"#/components/schemas/EntityId"}},"siteId":{"name":"siteId","in":"path","required":true,"description":"The unique id of the site","schema":{"type":"string"}}},"schemas":{"EntityId":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","description":"A unique entity identifier"},"SiteChannelSetup":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["builtin:slack"]},"setupSettings":{"type":"object","additionalProperties":false,"properties":{"allowedChannels":{"description":"List of allowed Slack channel names or patterns. If empty, all channels are allowed.","type":"array","items":{"$ref":"#/components/schemas/GenericChannelPattern"}}}}},"required":["type","setupSettings"]},{"type":"object","properties":{"type":{"type":"string","enum":["builtin:github"]},"setupSettings":{"type":"object","additionalProperties":false,"properties":{"allowedRepositories":{"description":"List of allowed GitHub repository names or patterns. If empty, all repositories are allowed.","type":"array","items":{"$ref":"#/components/schemas/GitHubRepositoryPattern"}}}}},"required":["type","setupSettings"]},{"type":"object","properties":{"type":{"type":"string","enum":["builtin:discord"]},"setupSettings":{"type":"object","additionalProperties":false,"properties":{"allowedChannels":{"description":"List of allowed Discord channel names or patterns. If empty, all channels are allowed.","type":"array","items":{"$ref":"#/components/schemas/GenericChannelPattern"}}}}},"required":["type","setupSettings"]}]},"GenericChannelPattern":{"type":"string","description":"A generic channel name or pattern. For example, \"general\" or \"support-*\".","pattern":"^[a-zA-Z0-9_\\*-]+$"},"GitHubRepositoryPattern":{"type":"string","description":"A GitHub repository name or pattern in the format \"owner/repository\". For example, \"my-org/my-repo\" or \"my-org/*\" to allow all repositories under \"my-org\".","pattern":"^[a-zA-Z0-9._*-]+\\/[a-zA-Z0-9._*-]+$"},"SiteChannelRole":{"type":"string","enum":["collaborator","support"]},"SiteChannel":{"allOf":[{"$ref":"#/components/schemas/SiteChannelSetup"},{"type":"object","properties":{"object":{"type":"string","enum":["site-channel"]},"id":{"type":"string","description":"Unique identifier for the site channel."},"status":{"$ref":"#/components/schemas/SiteChannelStatus"},"role":{"$ref":"#/components/schemas/SiteChannelRole"},"answers":{"type":"integer","minimum":0,"description":"Number of answers linked to this channel."},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"urls":{"type":"object","properties":{"location":{"type":"string","format":"uri","description":"URL of the site channel in the API."}},"required":["location"]}},"required":["object","id","status","role","answers","createdAt","urls"]}]},"SiteChannelStatus":{"type":"string","enum":["active","pending"]},"Timestamp":{"type":"string","format":"date-time"}}},"paths":{"/orgs/{organizationId}/sites/{siteId}/channels":{"post":{"operationId":"createSiteChannel","summary":"Create a site channel","tags":["site-channels"],"parameters":[{"$ref":"#/components/parameters/organizationId"},{"$ref":"#/components/parameters/siteId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/SiteChannelSetup"},{"type":"object","properties":{"role":{"$ref":"#/components/schemas/SiteChannelRole"}}}]}}}},"responses":{"201":{"description":"Site channel created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteChannel"}}}}}}}}}
```

## GET /orgs/{organizationId}/sites/{siteId}/channels/{siteChannelId}

> Get a site channel

```json
{"openapi":"3.1.0","info":{"title":"GitBook API","version":"0.0.1-beta"},"tags":[{"name":"site-channels","description":"Manage the channels used as origins for questions and answers in your site ask data.\n\n{% openapi-schemas spec=\"gitbook\" schemas=\"SiteChannel\" grouped=\"false\" %}\n    The SiteChannel object\n{% endopenapi-schemas %}\n"}],"servers":[{"url":"{host}/v1","variables":{"host":{"default":"https://api.gitbook.com"}}}],"security":[{"user":[]}],"components":{"securitySchemes":{"user":{"type":"http","scheme":"bearer"}},"parameters":{"organizationId":{"name":"organizationId","in":"path","required":true,"description":"The unique id of the organization","schema":{"$ref":"#/components/schemas/EntityId"}},"siteId":{"name":"siteId","in":"path","required":true,"description":"The unique id of the site","schema":{"type":"string"}},"siteChannelId":{"name":"siteChannelId","in":"path","required":true,"description":"The unique id of the site channel","schema":{"type":"string"}}},"schemas":{"EntityId":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","description":"A unique entity identifier"},"SiteChannel":{"allOf":[{"$ref":"#/components/schemas/SiteChannelSetup"},{"type":"object","properties":{"object":{"type":"string","enum":["site-channel"]},"id":{"type":"string","description":"Unique identifier for the site channel."},"status":{"$ref":"#/components/schemas/SiteChannelStatus"},"role":{"$ref":"#/components/schemas/SiteChannelRole"},"answers":{"type":"integer","minimum":0,"description":"Number of answers linked to this channel."},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"urls":{"type":"object","properties":{"location":{"type":"string","format":"uri","description":"URL of the site channel in the API."}},"required":["location"]}},"required":["object","id","status","role","answers","createdAt","urls"]}]},"SiteChannelSetup":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["builtin:slack"]},"setupSettings":{"type":"object","additionalProperties":false,"properties":{"allowedChannels":{"description":"List of allowed Slack channel names or patterns. If empty, all channels are allowed.","type":"array","items":{"$ref":"#/components/schemas/GenericChannelPattern"}}}}},"required":["type","setupSettings"]},{"type":"object","properties":{"type":{"type":"string","enum":["builtin:github"]},"setupSettings":{"type":"object","additionalProperties":false,"properties":{"allowedRepositories":{"description":"List of allowed GitHub repository names or patterns. If empty, all repositories are allowed.","type":"array","items":{"$ref":"#/components/schemas/GitHubRepositoryPattern"}}}}},"required":["type","setupSettings"]},{"type":"object","properties":{"type":{"type":"string","enum":["builtin:discord"]},"setupSettings":{"type":"object","additionalProperties":false,"properties":{"allowedChannels":{"description":"List of allowed Discord channel names or patterns. If empty, all channels are allowed.","type":"array","items":{"$ref":"#/components/schemas/GenericChannelPattern"}}}}},"required":["type","setupSettings"]}]},"GenericChannelPattern":{"type":"string","description":"A generic channel name or pattern. For example, \"general\" or \"support-*\".","pattern":"^[a-zA-Z0-9_\\*-]+$"},"GitHubRepositoryPattern":{"type":"string","description":"A GitHub repository name or pattern in the format \"owner/repository\". For example, \"my-org/my-repo\" or \"my-org/*\" to allow all repositories under \"my-org\".","pattern":"^[a-zA-Z0-9._*-]+\\/[a-zA-Z0-9._*-]+$"},"SiteChannelStatus":{"type":"string","enum":["active","pending"]},"SiteChannelRole":{"type":"string","enum":["collaborator","support"]},"Timestamp":{"type":"string","format":"date-time"}}},"paths":{"/orgs/{organizationId}/sites/{siteId}/channels/{siteChannelId}":{"get":{"operationId":"getSiteChannelById","summary":"Get a site channel","tags":["site-channels"],"parameters":[{"$ref":"#/components/parameters/organizationId"},{"$ref":"#/components/parameters/siteId"},{"$ref":"#/components/parameters/siteChannelId"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteChannel"}}}}}}}}}
```

## DELETE /orgs/{organizationId}/sites/{siteId}/channels/{siteChannelId}

> Delete a site channel

```json
{"openapi":"3.1.0","info":{"title":"GitBook API","version":"0.0.1-beta"},"tags":[{"name":"site-channels","description":"Manage the channels used as origins for questions and answers in your site ask data.\n\n{% openapi-schemas spec=\"gitbook\" schemas=\"SiteChannel\" grouped=\"false\" %}\n    The SiteChannel object\n{% endopenapi-schemas %}\n"}],"servers":[{"url":"{host}/v1","variables":{"host":{"default":"https://api.gitbook.com"}}}],"security":[{"user":[]}],"components":{"securitySchemes":{"user":{"type":"http","scheme":"bearer"}},"parameters":{"organizationId":{"name":"organizationId","in":"path","required":true,"description":"The unique id of the organization","schema":{"$ref":"#/components/schemas/EntityId"}},"siteId":{"name":"siteId","in":"path","required":true,"description":"The unique id of the site","schema":{"type":"string"}},"siteChannelId":{"name":"siteChannelId","in":"path","required":true,"description":"The unique id of the site channel","schema":{"type":"string"}}},"schemas":{"EntityId":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","description":"A unique entity identifier"}}},"paths":{"/orgs/{organizationId}/sites/{siteId}/channels/{siteChannelId}":{"delete":{"operationId":"deleteSiteChannelById","summary":"Delete a site channel","tags":["site-channels"],"parameters":[{"$ref":"#/components/parameters/organizationId"},{"$ref":"#/components/parameters/siteId"},{"$ref":"#/components/parameters/siteChannelId"}],"responses":{"204":{"description":"Site channel did not exist"},"205":{"description":"Site channel deleted"}}}}}}
```

## PATCH /orgs/{organizationId}/sites/{siteId}/channels/{siteChannelId}

> Update a site channel

```json
{"openapi":"3.1.0","info":{"title":"GitBook API","version":"0.0.1-beta"},"tags":[{"name":"site-channels","description":"Manage the channels used as origins for questions and answers in your site ask data.\n\n{% openapi-schemas spec=\"gitbook\" schemas=\"SiteChannel\" grouped=\"false\" %}\n    The SiteChannel object\n{% endopenapi-schemas %}\n"}],"servers":[{"url":"{host}/v1","variables":{"host":{"default":"https://api.gitbook.com"}}}],"security":[{"user":[]}],"components":{"securitySchemes":{"user":{"type":"http","scheme":"bearer"}},"parameters":{"organizationId":{"name":"organizationId","in":"path","required":true,"description":"The unique id of the organization","schema":{"$ref":"#/components/schemas/EntityId"}},"siteId":{"name":"siteId","in":"path","required":true,"description":"The unique id of the site","schema":{"type":"string"}},"siteChannelId":{"name":"siteChannelId","in":"path","required":true,"description":"The unique id of the site channel","schema":{"type":"string"}}},"schemas":{"EntityId":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","description":"A unique entity identifier"},"SiteChannelSetup":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["builtin:slack"]},"setupSettings":{"type":"object","additionalProperties":false,"properties":{"allowedChannels":{"description":"List of allowed Slack channel names or patterns. If empty, all channels are allowed.","type":"array","items":{"$ref":"#/components/schemas/GenericChannelPattern"}}}}},"required":["type","setupSettings"]},{"type":"object","properties":{"type":{"type":"string","enum":["builtin:github"]},"setupSettings":{"type":"object","additionalProperties":false,"properties":{"allowedRepositories":{"description":"List of allowed GitHub repository names or patterns. If empty, all repositories are allowed.","type":"array","items":{"$ref":"#/components/schemas/GitHubRepositoryPattern"}}}}},"required":["type","setupSettings"]},{"type":"object","properties":{"type":{"type":"string","enum":["builtin:discord"]},"setupSettings":{"type":"object","additionalProperties":false,"properties":{"allowedChannels":{"description":"List of allowed Discord channel names or patterns. If empty, all channels are allowed.","type":"array","items":{"$ref":"#/components/schemas/GenericChannelPattern"}}}}},"required":["type","setupSettings"]}]},"GenericChannelPattern":{"type":"string","description":"A generic channel name or pattern. For example, \"general\" or \"support-*\".","pattern":"^[a-zA-Z0-9_\\*-]+$"},"GitHubRepositoryPattern":{"type":"string","description":"A GitHub repository name or pattern in the format \"owner/repository\". For example, \"my-org/my-repo\" or \"my-org/*\" to allow all repositories under \"my-org\".","pattern":"^[a-zA-Z0-9._*-]+\\/[a-zA-Z0-9._*-]+$"},"SiteChannelRole":{"type":"string","enum":["collaborator","support"]},"SiteChannel":{"allOf":[{"$ref":"#/components/schemas/SiteChannelSetup"},{"type":"object","properties":{"object":{"type":"string","enum":["site-channel"]},"id":{"type":"string","description":"Unique identifier for the site channel."},"status":{"$ref":"#/components/schemas/SiteChannelStatus"},"role":{"$ref":"#/components/schemas/SiteChannelRole"},"answers":{"type":"integer","minimum":0,"description":"Number of answers linked to this channel."},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"urls":{"type":"object","properties":{"location":{"type":"string","format":"uri","description":"URL of the site channel in the API."}},"required":["location"]}},"required":["object","id","status","role","answers","createdAt","urls"]}]},"SiteChannelStatus":{"type":"string","enum":["active","pending"]},"Timestamp":{"type":"string","format":"date-time"}}},"paths":{"/orgs/{organizationId}/sites/{siteId}/channels/{siteChannelId}":{"patch":{"operationId":"updateSiteChannelById","summary":"Update a site channel","tags":["site-channels"],"parameters":[{"$ref":"#/components/parameters/organizationId"},{"$ref":"#/components/parameters/siteId"},{"$ref":"#/components/parameters/siteChannelId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/SiteChannelSetup"},{"type":"object","properties":{"role":{"$ref":"#/components/schemas/SiteChannelRole"}}}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteChannel"}}}}}}}}}
```
