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

# Deactivate a datasource

> Sets the datasource inactive. Requires datasources:publish.



## OpenAPI

````yaml /swagger/5.16/ai-studio-swagger.yml post /datasources/{id}/deactivate
openapi: 3.0.1
info:
  title: Midsommar API
  description: This is the API for the Midsommar user and group management system.
  termsOfService: http://swagger.io/terms/
  contact:
    name: API Support
    url: http://www.swagger.io/support
    email: support@swagger.io
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: '1.0'
servers:
  - url: //localhost:8080/api/v1
security: []
paths:
  /datasources/{id}/deactivate:
    post:
      tags:
        - datasources
      summary: Deactivate a datasource
      description: Sets the datasource inactive. Requires datasources:publish.
      parameters:
        - name: id
          in: path
          description: Datasource ID
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/api.DatasourceResponse'
        '403':
          description: Forbidden
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/api.ErrorResponse'
        '404':
          description: Not Found
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/api.ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    api.DatasourceResponse:
      type: object
      properties:
        attributes:
          type: object
          properties:
            active:
              type: boolean
            allow_internal_host:
              type: boolean
              description: |-
                AllowInternalHost: the datasource's own host may be an internal
                address (an administrator's switch).
            db_conn_api_key:
              type: string
            db_conn_string:
              type: string
            db_name:
              type: string
            db_source_type:
              type: string
            embed_api_key:
              type: string
            embed_model:
              type: string
            embed_url:
              type: string
            embed_vendor:
              type: string
            embedder_id:
              type: integer
            embedder_name:
              type: string
            files:
              type: array
              items:
                $ref: '#/components/schemas/api.FileStoreResponse'
            has_db_conn_api_key:
              type: boolean
            has_embed_api_key:
              type: boolean
            icon:
              type: string
            long_description:
              type: string
            name:
              type: string
            namespace:
              type: string
            privacy_score:
              type: integer
            short_description:
              type: string
            tags:
              type: array
              items:
                $ref: '#/components/schemas/api.TagResponse'
            tracing_content_mode_max:
              type: string
              description: Agent tracing content mode cap (Enterprise); "" is no cap.
            url:
              type: string
            user_id:
              type: integer
            workspace_id:
              type: integer
              description: |-
                WorkspaceID is the Workspace that owns the datasource (admin
                responses).
        governed_metadata:
          type: object
          description: Governed metadata (Enterprise); see LLMResponse.
        governed_metadata_status:
          type: string
        id:
          type: string
        type:
          type: string
      description: Datasource response model
    api.ErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              detail:
                type: string
              title:
                type: string
      description: Error response model
    api.FileStoreResponse:
      type: object
      properties:
        attributes:
          type: object
          properties:
            description:
              type: string
            file_name:
              type: string
            last_processed_on:
              type: string
            length:
              type: integer
            workspace_id:
              type: integer
              description: |-
                WorkspaceID is the Workspace that owns the entry (Enterprise
                Workspaces); a stored 0 reads as the Default.
        id:
          type: string
        type:
          type: string
      description: FileStore response model
    api.TagResponse:
      type: object
      properties:
        attributes:
          type: object
          properties:
            name:
              type: string
        id:
          type: string
        type:
          type: string
      description: Tag response model
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````