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

# Set Data Connection Active

> Sets a Data Connection for the title to either the active or deactivated state.

Allowed entity token types: title

## Error codes

This operation may return the following PlayFab errors:

| Error | Code |
| --- | --- |
| BillingInformationRequired | 1266 |
| EventSinkConnectionInvalid | 15000 |
| EventSinkConnectionUnauthorized | 15001 |
| EventSinkDatabaseNotFound | 15011 |
| EventSinkInsufficientRoleAssignment | 15013 |
| EventSinkLimitExceeded | 15003 |
| EventSinkNotFound | 15005 |
| EventSinkRegionInvalid | 15002 |
| EventSinkSasTokenInvalid | 15004 |
| EventSinkSasTokenPermissionInvalid | 15007 |
| EventSinkSecretInvalid | 15008 |
| EventSinkTenantIdInvalid | 15015 |
| EventSinkTitleUnauthorized | 15012 |
| ServiceUnavailable | 1123 |




## OpenAPI

````yaml /services/playfab/api-references/rest/events/events.openapi.json post /Event/SetDataConnectionActive
openapi: 3.0.0
info:
  version: '260922'
  title: PlayFab Events API
  description: >-
    Write custom PlayStream and Telemetry events for any PlayFab entity.
    Telemetry events can be used for analytic, reporting, or debugging.
    PlayStream events can do all of that and also trigger custom actions in near
    real-time.
  termsOfService: https://playfab.com/terms/
  contact:
    url: https://community.playfab.com/index.html
  license:
    name: Apache 2.0
    url: https://github.com/PlayFab/API_Specs/blob/master/LICENSE
servers:
  - url: https://{titleId}.playfabapi.com
    description: PlayFab title endpoint
    variables:
      titleId:
        default: your_title_id
        description: Your PlayFab title ID (hex).
security: []
tags:
  - name: PlayStream
    description: PlayStream Management APIs
  - name: PlayStream Events
    description: PlayStream Events APIs
paths:
  /Event/SetDataConnectionActive:
    post:
      tags:
        - PlayStream Events
      summary: Set Data Connection Active
      description: >
        Sets a Data Connection for the title to either the active or deactivated
        state.


        Allowed entity token types: title


        ## Error codes


        This operation may return the following PlayFab errors:


        | Error | Code |

        | --- | --- |

        | BillingInformationRequired | 1266 |

        | EventSinkConnectionInvalid | 15000 |

        | EventSinkConnectionUnauthorized | 15001 |

        | EventSinkDatabaseNotFound | 15011 |

        | EventSinkInsufficientRoleAssignment | 15013 |

        | EventSinkLimitExceeded | 15003 |

        | EventSinkNotFound | 15005 |

        | EventSinkRegionInvalid | 15002 |

        | EventSinkSasTokenInvalid | 15004 |

        | EventSinkSasTokenPermissionInvalid | 15007 |

        | EventSinkSecretInvalid | 15008 |

        | EventSinkTenantIdInvalid | 15015 |

        | EventSinkTitleUnauthorized | 15012 |

        | ServiceUnavailable | 1123 |
      operationId: SetDataConnectionActive
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetDataConnectionActiveRequest'
      responses:
        '200':
          $ref: '#/components/responses/SetDataConnectionActiveResponse'
        '400':
          $ref: '#/components/responses/ApiErrorWrapper'
      security:
        - EntityToken: []
components:
  schemas:
    SetDataConnectionActiveRequest:
      type: object
      properties:
        Active:
          description: >-
            Whether to set the data connection to active (true) or deactivated
            (false).
          type: boolean
        CustomTags:
          description: >-
            The optional custom tags associated with the request (e.g. build
            number, external trace identifiers, etc.).
          type: object
        Name:
          description: The name of the data connection to update.
          type: string
      required:
        - Name
        - Active
      example:
        Name: MyDataConnection
        Active: false
    SetDataConnectionActiveResponse:
      type: object
      properties:
        DataConnection:
          allOf:
            - $ref: '#/components/schemas/DataConnectionDetails'
          description: >-
            The most current details about the data connection that was to be
            updated.
        WasUpdated:
          description: >-
            Indicates whether or not the data connection was updated. If false,
            the data connection was already in the desired state.
          type: boolean
      required:
        - WasUpdated
    ApiErrorWrapper:
      description: The basic wrapper around every failed API response
      type: object
      properties:
        code:
          description: Numerical HTTP code
          type: integer
        status:
          description: String HTTP code
          type: string
        error:
          description: Playfab error code
          type: string
        errorCode:
          description: Numerical PlayFab error code
          type: integer
        errorMessage:
          description: Description for the PlayFab errorCode
          type: string
        errorDetails:
          description: Detailed description of individual issues with the request object
          type: object
      required:
        - code
        - errorCode
    DataConnectionDetails:
      type: object
      properties:
        ConnectionSettings:
          allOf:
            - $ref: '#/components/schemas/DataConnectionSettings'
          description: Settings of the data connection.
        IsActive:
          description: Whether or not the connection is currently active.
          type: boolean
        Name:
          description: The name of the data connection.
          type: string
        Status:
          allOf:
            - $ref: '#/components/schemas/DataConnectionStatusDetails'
          description: Current status of the data connection, if any.
        Type:
          allOf:
            - $ref: '#/components/schemas/DataConnectionType'
          description: The type of data connection.
      required:
        - Name
        - Type
        - IsActive
        - ConnectionSettings
    DataConnectionSettings:
      type: object
      properties:
        AzureBlobSettings:
          allOf:
            - $ref: '#/components/schemas/DataConnectionAzureBlobSettings'
          description: Settings if the type of connection is AzureBlobStorage.
        AzureDataExplorerSettings:
          allOf:
            - $ref: '#/components/schemas/DataConnectionAzureDataExplorerSettings'
          description: Settings if the type of connection is AzureDataExplorer.
        AzureFabricKQLSettings:
          allOf:
            - $ref: '#/components/schemas/DataConnectionFabricKQLSettings'
          description: Settings if the type of connection is FabricKQL.
    DataConnectionStatusDetails:
      type: object
      properties:
        Error:
          description: The name of the error affecting the data connection, if any.
          type: string
        ErrorMessage:
          description: >-
            A description of the error affecting the data connection, if any.
            This may be empty for some errors.
          type: string
        MostRecentErrorTime:
          description: >-
            The most recent time of the error affecting the data connection, if
            any.
          type: string
        State:
          allOf:
            - $ref: '#/components/schemas/DataConnectionErrorState'
          description: Indicates if the connection is in a normal state or error state.
    DataConnectionType:
      type: string
      enum:
        - AzureBlobStorage
        - AzureDataExplorer
        - FabricKQL
    DataConnectionAzureBlobSettings:
      type: object
      properties:
        AccountName:
          description: Name of the storage account.
          type: string
        ContainerName:
          description: Name of the container.
          type: string
        TenantId:
          description: Azure Entra Tenant Id.
          type: string
    DataConnectionAzureDataExplorerSettings:
      type: object
      properties:
        ClusterUri:
          description: The URI of the ADX cluster.
          type: string
        Database:
          description: The database to write to.
          type: string
        Table:
          description: The table to write to.
          type: string
    DataConnectionFabricKQLSettings:
      type: object
      properties:
        ClusterUri:
          description: The URI of the Fabric cluster.
          type: string
        Database:
          description: The database to write to.
          type: string
        Table:
          description: The table to write to.
          type: string
    DataConnectionErrorState:
      type: string
      enum:
        - OK
        - Error
  responses:
    SetDataConnectionActiveResponse:
      description: ''
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: integer
                description: >-
                  The Http status code. If X-ReportErrorAsSuccess header is set
                  to true, this will report the actual http error code.
              status:
                type: string
                description: The Http status code as a string.
              data:
                $ref: '#/components/schemas/SetDataConnectionActiveResponse'
    ApiErrorWrapper:
      description: This is the outer wrapper for all responses with errors
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorWrapper'
  securitySchemes:
    EntityToken:
      type: apiKey
      in: header
      name: X-EntityToken
      description: >-
        This API requires an Entity Session Token, available from the Entity
        GetEntityToken method.

````

## Related topics

- [Set Data Connection Active](/services/playfab/api-references/rest/events/play-stream-events/set-data-connection-active.md)
- [PlayFab Services SDK Release Notes 2025](/services/playfab/release-notes/2025.md)
- [Set Data Connection](/api-reference/playstream-events/set-data-connection.md)
- [Data Connections quickstart](/services/playfab/data-analytics/export-data/data-connection-quickstart.md)
- [PFEventsDataConnectionDetails](/services/playfab/api-references/c/pfeventstypes/structs/pfeventsdataconnectiondetails.md)
