> ## 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 Microsoft Teams

> Remove the Teams channel linked to the ticket with `linkTicketToTeams`. Primo posts a last card in the thread, and its replies stop reaching the ticket. Refused when ticket links are not open for the company (403 `TeamsTicketLinksDisabledError`), the ticket has no link made by hand (404 `TicketHasNoTeamsLinkError`), or the ticket was raised from Teams and keeps its thread (409 `ChatSourcedTicketLinkLockedError`).

Key: WriteScope: Company


## OpenAPI

````yaml https://api.getprimo.com/openapi.json delete /tickets/{ticketId}/teams-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}/teams-link:
    delete:
      tags:
        - Tickets
      summary: Unlink a ticket from Microsoft Teams
      description: >-
        Remove the Teams channel linked to the ticket with `linkTicketToTeams`.
        Primo posts a last card in the thread, and its replies stop reaching the
        ticket. Refused when ticket links are not open for the company (403
        `TeamsTicketLinksDisabledError`), the ticket has no link made by hand
        (404 `TicketHasNoTeamsLinkError`), or the ticket was raised from Teams
        and keeps its thread (409 `ChatSourcedTicketLinkLockedError`).
      operationId: unlinkTicketFromTeams
      parameters:
        - name: ticketId
          required: true
          in: path
          schema:
            type: string
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TicketTeamsLinkOutput_Output'
components:
  schemas:
    TicketTeamsLinkOutput_Output:
      type: object
      properties:
        connected:
          type: boolean
          description: Whether the company has a Microsoft Teams tenant connected to Primo
        link:
          description: Null when the ticket is not linked to Teams
          anyOf:
            - type: object
              properties:
                origin:
                  description: >-
                    `LINKED`: linked by hand. `TICKET_SOURCE`: the Teams thread
                    or chat the ticket was raised in, which cannot change
                  type: string
                  enum:
                    - LINKED
                    - TICKET_SOURCE
                label:
                  description: The team and channel (`IT › Support`), null for a chat
                  anyOf:
                    - type: string
                    - type: 'null'
                url:
                  description: Opens the thread in Teams, null for a chat
                  anyOf:
                    - type: string
                    - type: 'null'
                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. `TEAMS_DISCONNECTED`:
                    the Microsoft 365 tenant was disconnected from Primo.
                    `CHANNEL_UNAVAILABLE`: the channel was deleted or Primo can
                    no longer post in it
                  type: string
                  enum:
                    - ACTIVE
                    - TEAMS_DISCONNECTED
                    - CHANNEL_UNAVAILABLE
              required:
                - origin
                - 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.