---
schema_version: "1"
id: aae4f1a8bb3f497c259e2ed07f9752b299c86cf458b00c755e9c936f0e7a0fb1
title: AgentforceConnectionInfo
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/genai/agentforce-mobile-sdk/references/ios/agentforce-connection-info-ios.md
canonical_url: https://developer.salesforce.com/docs/ai/agentforce-mobile-sdk/references/agentforce-mobile-sdk/agentforce-connection-info-ios.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 0bb7b83ce6a670736d0a1af43d61c53c74c7d5012bb82d25f05624af414cd174
products:
  - Agentforce Mobile SDK
  - Agentforce and Einstein Generative AI
---
# AgentforceConnectionInfo

## Overview

Structure that encapsulates connection information for Agentforce services, including the service API URL and tenant identifier. This information is used to route requests to the appropriate Agentforce service endpoints.

## Declaration

```swift
struct AgentforceConnectionInfo: Codable
```

## Properties

| Property   | Type     | Description                                                                                               |
| ---------- | -------- | --------------------------------------------------------------------------------------------------------- |
| `sfapURL`  | `String` | The Salesforce API Platform (SFAP) URL used for Agentforce service communication.                         |
| `tenantId` | `String` | The tenant identifier that uniquely identifies the Salesforce organization's Agentforce service instance. |

## Methods

| Method | Signature                 | Description                                                                   |
| ------ | ------------------------- | ----------------------------------------------------------------------------- |
| `init` | `init(sfapURL:tenantId:)` | Creates a connection info instance with the specified SFAP URL and tenant ID. |

## Configuration Patterns

```swift
// Provide connection information directly
let connectionInfo = AgentforceConnectionInfo(
    sfapURL: "https://api.salesforce.com",
    tenantId: "core/prod/00D000000000000AAA"
)

let config = AgentforceConfiguration(
    user: currentUser,
    forceConfigEndpoint: "https://myorg.salesforce.com",
    agentforceFeatureFlagSettings: featureFlags,
    agentforceConnectionInfo: connectionInfo,
    salesforceNetwork: networkManager
)
```

When `agentforceConnectionInfo` is `nil` in `AgentforceConfiguration`, the SDK automatically queries connection information from the configured `forceConfigEndPoint` during initialization.

```swift
let config = AgentforceConfiguration(
    user: currentUser,
    forceConfigEndpoint: "https://myorg.salesforce.com",
    agentforceFeatureFlagSettings: featureFlags,
    agentforceConnectionInfo: nil, // SDK will discover automatically
    salesforceNetwork: networkManager
)
```
