> ## Documentation Index
> Fetch the complete documentation index at: https://docs.shiftkeeper.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Attach or update the Slack user group for a schedule

> Attach a Slack user group to a schedule. If the schedule already has a Slack user group attached, it will be updated.

Note that user groups are available only in paid Slack plans.



## OpenAPI

````yaml https://api.shiftkeeper.io/openapi.json put /schedules/{schedule_id}/slack_user_group/
openapi: 3.1.0
info:
  title: Shiftkeeper API
  description: API reference to interact with Shiftkeeper programatically
  version: 0.0.1
servers:
  - url: https://api.shiftkeeper.io
security:
  - apiKey: []
externalDocs:
  url: https://docs.shiftkeeper.io
  description: Learn more about Shiftkeeper
paths:
  /schedules/{schedule_id}/slack_user_group/:
    put:
      tags:
        - Schedules
      summary: Attach or update the Slack user group for a schedule
      description: >-
        Attach a Slack user group to a schedule. If the schedule already has a
        Slack user group attached, it will be updated.


        Note that user groups are available only in paid Slack plans.
      parameters:
        - schema:
            type: string
          examples:
            sch_oKjoLJUl47g7OYYVPUG5t:
              value: sch_oKjoLJUl47g7OYYVPUG5t
            sch_kje7ER643ED0STVnB8Zc9:
              value: sch_kje7ER643ED0STVnB8Zc9
          in: path
          name: schedule_id
          required: true
          description: The ID of the schedule.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewSlackUserGroup'
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  user_group:
                    $ref: '#/components/schemas/ScheduleSlackUserGroup'
                required:
                  - user_group
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/NotFoundError'
                required:
                  - error
        '422':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                      docs_url:
                        type: string
                      status:
                        type: number
                        enum:
                          - 422
                      code:
                        type: string
                        enum:
                          - slack_group_permission_denied
                          - slack_group_only_available_for_paid_teams
                          - slack_group_duplicate_name
                          - slack_group_duplicate_handle_name
                    required:
                      - message
                      - status
                      - code
                    example:
                      code: unprocessable_entity
                      status: 422
                      message: The request cannot be processed
                required:
                  - error
              example:
                error:
                  code: slack_group_only_available_for_paid_teams
                  message: >-
                    User groups are available only on paid Slack plans.
                    Unfortunately, your current Slack plan does not support
                    them.
                  status: 422
                  docs_url: >-
                    https://docs.shiftkeeper.io/api-reference/errors#slack-group-only-available-for-paid-teams
components:
  schemas:
    NewSlackUserGroup:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 60
          description: The name of the user group.
        handle:
          type: string
          pattern: ^[a-zA-Z0-9_-]+$
          minLength: 1
          maxLength: 60
          description: The handle of the user group.
        description:
          type: string
          maxLength: 140
          description: The description of the user group.
      required:
        - name
        - handle
      examples:
        - name: Incident responders
          handle: incident-responders
    ScheduleSlackUserGroup:
      type: object
      properties:
        id:
          type: string
          description: The Slack ID of the user group.
        name:
          type: string
          description: The name of the user group.
        handle:
          type: string
          description: The handle of the user group.
        description:
          type: string
          description: The description of the user group.
      required:
        - id
        - name
        - handle
      examples:
        - id: S083J1KTL9X
          name: Incident responders
          handle: incident-responders
    NotFoundError:
      type: object
      properties:
        message:
          type: string
        docs_url:
          type: string
        status:
          type: number
          const: 404
        code:
          type: string
          const: not_found
      required:
        - message
        - status
        - code
      example:
        code: not_found
        status: 404
        message: The requested resource was not found
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Enter your API key which starts with 'keeper_'

````