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

# Connect a Slack workspace

> Exchange a Slack OAuth authorization code for a workspace connection. Obtain the code via Slack's OAuth flow using your registered redirect URI.



## OpenAPI

````yaml /api-reference/v1/slack-v1.yaml post /integrations/slack/connect
openapi: 3.0.3
info:
  title: Coval Slack Integration API
  version: 1.0.0
  description: >

    Connect, disconnect, and read the status of your organization's Slack
    integration.

    Connecting exchanges a Slack OAuth authorization code for a workspace
    connection.
  contact:
    name: Coval API Support
    email: support@coval.dev
    url: https://docs.coval.ai
  license:
    name: Proprietary
    url: https://coval.dev/terms
servers:
  - url: https://api.coval.dev/v1
    description: Production API
security:
  - ApiKeyAuth: []
tags:
  - name: Integrations
    description: Third-party integration status
paths:
  /integrations/slack/connect:
    post:
      tags:
        - Integrations
      summary: Connect a Slack workspace
      description: >-
        Exchange a Slack OAuth authorization code for a workspace connection.
        Obtain the code via Slack's OAuth flow using your registered redirect
        URI.
      operationId: connectSlack
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConnectSlackRequest'
      responses:
        '200':
          description: Slack workspace connected
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectSlackResponse'
        '400':
          description: Invalid request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/PermissionDenied'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ConnectSlackRequest:
      type: object
      required:
        - code
        - redirect_uri
      properties:
        code:
          type: string
          description: Slack OAuth authorization code to exchange.
        redirect_uri:
          type: string
          description: The redirect URI registered with the Slack OAuth app.
    ConnectSlackResponse:
      type: object
      required:
        - team_name
        - connected
      properties:
        team_name:
          type: string
          description: Connected Slack workspace/team name.
          example: Acme Corp
        connected:
          type: boolean
          description: True when the workspace is connected.
          example: true
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - details
          properties:
            code:
              type: string
              enum:
                - INVALID_ARGUMENT
                - UNAUTHENTICATED
                - PERMISSION_DENIED
                - NOT_FOUND
                - ALREADY_EXISTS
                - INTERNAL
              example: UNAUTHENTICATED
            message:
              type: string
              example: Authentication failed
            details:
              type: array
              items:
                type: object
                properties:
                  field:
                    type: string
                    nullable: true
                  description:
                    type: string
  responses:
    Unauthorized:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: UNAUTHENTICATED
              message: Authentication failed
              details:
                - field: X-API-Key
                  description: Invalid or missing API key
    PermissionDenied:
      description: API key lacks required permission scope
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: PERMISSION_DENIED
              message: Insufficient permissions
              details:
                - field: permissions
                  description: 'API key does not have required permission: integrations:read'
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: INTERNAL
              message: Internal server error
              details:
                - description: An unexpected error occurred
    ServiceUnavailable:
      description: >-
        Service temporarily unavailable (transient organization DB routing
        outage; retryable)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: INTERNAL
              message: Service temporarily unavailable
              details:
                - description: Database routing is temporarily unavailable. Please retry.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for authentication

````