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

# Unlink a ticket from Slack

> Remove the Slack channel or direct messages linked to the ticket with `linkTicketToSlack`. Primo posts a last message in the thread, and its replies stop reaching the ticket. Refused when Slack links are not open for the company (403 `SlackTicketLinksDisabledError`), the ticket has no link (404 `TicketHasNoSlackLinkError`), or the ticket was raised from Slack and keeps its thread (409 `SlackSourcedTicketLinkLockedError`).

Key: WriteScope: Company


## OpenAPI

````yaml https://api.getprimo.com/openapi.json delete /tickets/{ticketId}/slack-link
openapi: 3.1.1
info:
  title: Public API - BETA
  description: Read docs on https://docs.getprimo.com/
  version: '1.0'
  contact: {}
servers:
  - url: https://api.getprimo.com
security:
  - apikey: []
tags: []
paths:
  /tickets/{ticketId}/slack-link:
    delete:
      tags:
        - Tickets
      summary: Unlink a ticket from Slack
      description: >-
        Remove the Slack channel or direct messages linked to the ticket with
        `linkTicketToSlack`. Primo posts a last message in the thread, and its
        replies stop reaching the ticket. Refused when Slack links are not open
        for the company (403 `SlackTicketLinksDisabledError`), the ticket has no
        link (404 `TicketHasNoSlackLinkError`), or the ticket was raised from
        Slack and keeps its thread (409 `SlackSourcedTicketLinkLockedError`).
      operationId: unlinkTicketFromSlack
      parameters:
        - name: ticketId
          required: true
          in: path
          schema:
            type: string
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TicketSlackLinkOutput_Output'
components:
  schemas:
    TicketSlackLinkOutput_Output:
      type: object
      properties:
        connected:
          type: boolean
          description: Whether the company has a Slack workspace connected to Primo
        link:
          description: Null when the ticket is not linked to Slack
          anyOf:
            - type: object
              properties:
                origin:
                  description: >-
                    `LINKED`: linked by hand. `TICKET_SOURCE`: the Slack thread
                    the ticket was raised in, which cannot change
                  type: string
                  enum:
                    - LINKED
                    - TICKET_SOURCE
                kind:
                  description: A Slack channel, or the direct messages of one person
                  type: string
                  enum:
                    - CHANNEL
                    - DM
                label:
                  description: The channel name (`#it-team`) or the person name
                  anyOf:
                    - type: string
                    - type: 'null'
                url:
                  description: Opens the channel or the direct messages in Slack
                  type: string
                linkedByName:
                  description: Who linked it, null for the thread the ticket was raised in
                  anyOf:
                    - type: string
                    - type: 'null'
                linkedAt:
                  anyOf:
                    - type: string
                      format: date-time
                      pattern: >-
                        ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                    - type: 'null'
                status:
                  description: >-
                    `ACTIVE`: messages reach the thread. `SLACK_DISCONNECTED`:
                    the Slack workspace was disconnected from Primo.
                    `CHANNEL_UNAVAILABLE`: the channel was archived or Primo
                    left it
                  type: string
                  enum:
                    - ACTIVE
                    - SLACK_DISCONNECTED
                    - CHANNEL_UNAVAILABLE
              required:
                - origin
                - kind
                - label
                - url
                - linkedByName
                - linkedAt
                - status
              additionalProperties: false
            - type: 'null'
      required:
        - connected
        - link
      additionalProperties: false
  securitySchemes:
    apikey:
      scheme: bearer
      bearerFormat: API key
      type: http
      description: >-
        Use your Primo API key in the Authorization header as `Bearer
        <API_KEY>`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.