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

# Upsert Slack installation

> Creates or updates an installation row for a workspace. Called by the OAuth proxy after `oauth.v2.access` succeeds. Returns 409 if the project has no active Slack app config (caller must `PUT /projects/:projectId/slack` first).



## OpenAPI

````yaml https://spectrum.photon.codes/openapi/json put /projects/{projectId}/slack/installations/{teamId}
openapi: 3.1.0
info:
  title: Spectrum Cloud External API
  description: Client-facing API for Spectrum Cloud.
  version: 1.0.0
servers:
  - url: https://spectrum.photon.codes
security: []
tags:
  - name: billing
    description: Billing and subscription operations
  - name: imessage
    description: iMessage platform operations
  - name: lines
    description: Phone line enumeration across platforms
  - name: platforms
    description: Platform management operations
  - name: users
    description: User operations
  - name: voice
    description: Voice platform operations
  - name: webhooks
    description: Webhook registration for receiving Spectrum events
  - name: whatsapp-business
    description: WhatsApp Business platform operations
  - name: slack
    description: Slack platform operations
paths:
  /projects/{projectId}/slack/installations/{teamId}:
    put:
      tags:
        - slack
      summary: Upsert Slack installation
      description: >-
        Creates or updates an installation row for a workspace. Called by the
        OAuth proxy after `oauth.v2.access` succeeds. Returns 409 if the project
        has no active Slack app config (caller must `PUT
        /projects/:projectId/slack` first).
      operationId: putProjectsByProjectIdSlackInstallationsByTeamId
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        - name: teamId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                teamName:
                  type: string
                  minLength: 1
                appId:
                  type: string
                  minLength: 1
                botToken:
                  type: string
                  minLength: 1
                botRefreshToken:
                  type: string
                  minLength: 1
                botTokenExpiresInSec:
                  type: integer
                  exclusiveMinimum: 0
                  maximum: 9007199254740991
                botUserId:
                  type: string
                  minLength: 1
                grantedScopes:
                  type: array
                  items:
                    type: string
              required:
                - teamName
                - appId
                - botToken
                - botUserId
                - grantedScopes
              additionalProperties: false
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                teamName:
                  type: string
                  minLength: 1
                appId:
                  type: string
                  minLength: 1
                botToken:
                  type: string
                  minLength: 1
                botRefreshToken:
                  type: string
                  minLength: 1
                botTokenExpiresInSec:
                  type: integer
                  exclusiveMinimum: 0
                  maximum: 9007199254740991
                botUserId:
                  type: string
                  minLength: 1
                grantedScopes:
                  type: array
                  items:
                    type: string
              required:
                - teamName
                - appId
                - botToken
                - botUserId
                - grantedScopes
              additionalProperties: false
          multipart/form-data:
            schema:
              type: object
              properties:
                teamName:
                  type: string
                  minLength: 1
                appId:
                  type: string
                  minLength: 1
                botToken:
                  type: string
                  minLength: 1
                botRefreshToken:
                  type: string
                  minLength: 1
                botTokenExpiresInSec:
                  type: integer
                  exclusiveMinimum: 0
                  maximum: 9007199254740991
                botUserId:
                  type: string
                  minLength: 1
                grantedScopes:
                  type: array
                  items:
                    type: string
              required:
                - teamName
                - appId
                - botToken
                - botUserId
                - grantedScopes
              additionalProperties: false
      responses:
        '200':
          description: Response for status 200
          content:
            application/json:
              schema:
                type: object
                properties:
                  succeed:
                    type: boolean
                    const: true
                  data:
                    type: object
                    properties:
                      installationId:
                        type: string
                      appConfigId:
                        type: string
                      projectId:
                        type: string
                      teamId:
                        type: string
                      teamName:
                        type: string
                      appId:
                        type: string
                      botToken:
                        type: string
                      botRefreshToken:
                        anyOf:
                          - type: string
                          - type: 'null'
                      botTokenExpiresAt:
                        anyOf:
                          - type: string
                          - type: 'null'
                      botUserId:
                        type: string
                      grantedScopes:
                        type: array
                        items:
                          type: string
                      installedAt:
                        type: string
                      updatedAt:
                        type: string
                    required:
                      - installationId
                      - appConfigId
                      - projectId
                      - teamId
                      - teamName
                      - appId
                      - botToken
                      - botRefreshToken
                      - botTokenExpiresAt
                      - botUserId
                      - grantedScopes
                      - installedAt
                      - updatedAt
                    additionalProperties: false
                required:
                  - succeed
                  - data
                additionalProperties: false

````