---
title: "Social Connection"
description: "Discover how to manage, create, and update Social Connections within your directories easily. (Gitana 4.0)"
product: "Gitana"
version: "4.0"
url: "/documentation/gitana/4.0/reference/types/connection"
---

# <a id="top"></a>Social Connection

An Object

1.  [Platform](/documentation/gitana/4.0/reference/types/platform.md)
2.  [Directory](/documentation/gitana/4.0/reference/types/directory.md)
3.  [Social Connection](/documentation/gitana/4.0/reference/types/connection.md)

##### Table of Contents

- [Overview](#top "Overview")
- [Parent](#parent "Parent")
- [Properties](#properties "Properties")
- [Methods](#methods "Methods")
- [Schema](#schema "Schema")

> **Note:** Drop in one of our language drivers to accelerate your development.  
> Here are links to some of our popular [Cookbooks](/documentation/gitana/4.0/developers/cookbooks/overview.md) to help you get started!
> 
> - [C#](/documentation/gitana/4.0/developers/cookbooks/csharp.md)
> - [Go](/documentation/gitana/4.0/developers/cookbooks/go.md)
> - [Java](/documentation/gitana/4.0/developers/cookbooks/java.md)
> - [JavaScript](/documentation/gitana/4.0/developers/cookbooks/javascript2.md)
> - [PHP](/documentation/gitana/4.0/developers/cookbooks/php.md)
> - [Python](/documentation/gitana/4.0/developers/cookbooks/python.md)
> - [Ruby](/documentation/gitana/4.0/developers/cookbooks/ruby.md)

## <a id="parent"></a>Parent

This Social Connection is contained within a [Directory](/documentation/gitana/4.0/reference/types/directory.md).

## <a id="properties"></a>Properties

The following properties are available:

| Property | Type | Default | Read-Only | Description |
| --- | --- | --- | --- | --- |
| \_doc | string |  | No | The primary ID |
| \_system | object |  | No | Metadata maintained by the system |
| accessToken | string |  | No |  |
| displayName | string |  | No |  |
| expireTime | string |  | No |  |
| identity-id | string |  | No |  |
| imageUrl | string |  | No |  |
| profileUrl | string |  | No |  |
| providerId | string |  | No |  |
| providerUserId | string |  | No |  |
| refreshToken | string |  | No |  |
| secret | string |  | No |  |

## <a id="methods"></a>Methods

The following methods are available:

- [Check Permission](#post-directories-directoryid-connections-connectionid-permissions-permissionid-check "Check Permission")
- [Check Single Authority](#post-directories-directoryid-connections-connectionid-authorities-authorityid-check "Check Single Authority")
- [Check multiple Authorities](#post-directories-directoryid-connections-authorities-check "Check multiple Authorities")
- [Check multiple Permissions](#post-directories-directoryid-connections-permissions-check "Check multiple Permissions")
- [Create Social Connection](#post-directories-directoryid-connections "Create Social Connection")
- [Delete Social Connection](#delete-directories-directoryid-connections-connectionid "Delete Social Connection")
- [Export Social Connection](#post-directories-directoryid-connections-connectionid-export "Export Social Connection")
- [Finduser Connections](#post-domains-domainid-connections-finduser "Finduser Connections")
- [Grant Authority](#post-directories-directoryid-connections-connectionid-authorities-authorityid-grant "Grant Authority")
- [Import Social Connection](#post-directories-directoryid-connections-connectionid-import "Import Social Connection")
- [List Connections](#get-directories-directoryid-identities-identityid-connections "List Connections")
- [Lists Social Connection](#get-directories-directoryid-connections "Lists Social Connection")
- [Queries for Social Connection](#post-directories-directoryid-connections-query "Queries for Social Connection")
- [Read ACL](#get-directories-directoryid-connections-connectionid-acl-list "Read ACL")
- [Read ACL for Principal](#get-directories-directoryid-connections-connectionid-acl "Read ACL for Principal")
- [Read Authorities Report](#post-directories-directoryid-connections-connectionid-authorities "Read Authorities Report")
- [Read Social Connection](#get-directories-directoryid-connections-connectionid "Read Social Connection")
- [Revoke Authority](#post-directories-directoryid-connections-connectionid-authorities-authorityid-revoke "Revoke Authority")
- [Sync Connections](#post-domains-domainid-connections-sync "Sync Connections")
- [Update Social Connection](#put-directories-directoryid-connections-connectionid "Update Social Connection")

### <a id="post-directories-directoryid-connections-connectionid-permissions-permissionid-check"></a>Check Permission

Checks whether one or more authorities against the specified connection are granted for a given set of users

POST /directories/{directoryId}/connections/{connectionId}/permissions/{permissionId}/check

#### Parameters

| Name | Required | Type | Description |
| --- | --- | --- | --- |
| directoryId | true | string | The ID of the directory |
| connectionId | true | string | The ID of the connection |
| permissionId | true | string | The ID of the permission |
| id | true | string |  |

#### Response

```json
{
  "$ref": "#/components/schemas/checkPermission"
}
```

### <a id="post-directories-directoryid-connections-connectionid-authorities-authorityid-check"></a>Check Single Authority

Checks whether a single authority is granted against the specified connection for the given user

POST /directories/{directoryId}/connections/{connectionId}/authorities/{authorityId}/check

#### Parameters

| Name | Required | Type | Description |
| --- | --- | --- | --- |
| directoryId | true | string | The ID of the directory |
| connectionId | true | string | The ID of the connection |
| authorityId | true | string | The ID or authority key for the authority |
| id | true | string |  |

#### Response

```json
{
  "type": "object",
  "description": "Check",
  "extends": "status",
  "properties": {
    "check": {
      "type": "boolean"
    },
    "ok": null
  }
}
```

### <a id="post-directories-directoryid-connections-authorities-check"></a>Check multiple Authorities

Checks whether one or more authorities against the specified connection are granted for a given set of users

POST /directories/{directoryId}/connections/authorities/check

#### Parameters

| Name | Required | Type | Description |
| --- | --- | --- | --- |
| directoryId | true | string | The ID of the directory |

#### Response

```json
{
  "type": "object",
  "description": "Check Multiple Authorities Out",
  "properties": {
    "checks": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "permissionedId": {
            "type": "string"
          },
          "principalId": {
            "type": "string"
          },
          "authorityId": {
            "type": "string"
          },
          "result": {
            "type": "boolean"
          }
        }
      }
    }
  }
}
```

### <a id="post-directories-directoryid-connections-permissions-check"></a>Check multiple Permissions

Checks whether one or more permissions against the specified connection are granted for a given set of users

POST /directories/{directoryId}/connections/permissions/check

#### Parameters

| Name | Required | Type | Description |
| --- | --- | --- | --- |
| directoryId | true | string | The ID of the directory |

#### Response

```json
{
  "type": "object",
  "description": "Check Multiple Permissions Out",
  "properties": {
    "checks": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "permissionedId": {
            "type": "string"
          },
          "principalId": {
            "type": "string"
          },
          "permissionId": {
            "type": "string"
          },
          "result": {
            "type": "boolean"
          }
        }
      }
    }
  }
}
```

### <a id="post-directories-directoryid-connections"></a>Create Social Connection

Creates a new Social Connection

POST /directories/{directoryId}/connections

#### Parameters

| Name | Required | Type | Description |
| --- | --- | --- | --- |
| directoryId | true | string | The ID of the directory |

#### Response

```json
{
  "type": "object",
  "description": "Status of Operation",
  "properties": {
    "ok": {
      "type": "boolean",
      "description": "Indicates whether the operation succeeded or not"
    }
  }
}
```

### <a id="delete-directories-directoryid-connections-connectionid"></a>Delete Social Connection

Deletes an existing Social Connection

DELETE /directories/{directoryId}/connections/{connectionId}

#### Parameters

| Name | Required | Type | Description |
| --- | --- | --- | --- |
| directoryId | true | string | The ID of the directory |
| connectionId | true | string | The ID of the connection |

#### Response

```json
{
  "type": "object",
  "description": "Status of Operation",
  "properties": {
    "ok": {
      "type": "boolean",
      "description": "Indicates whether the operation succeeded or not"
    }
  }
}
```

### <a id="post-directories-directoryid-connections-connectionid-export"></a>Export Social Connection

Starts an export job for this resource

POST /directories/{directoryId}/connections/{connectionId}/export

#### Parameters

| Name | Required | Type | Description |
| --- | --- | --- | --- |
| directoryId | true | string | The ID of the directory |
| connectionId | true | string | The ID of the connection |
| groupId | false | string | The Group ID to be assigned to the exported archive |
| artifactId | false | string | The Artifact ID to be assigned to the exported archive |
| versionId | false | string | The Version ID to be assigned to the exported archive |
| vaultId | false | string | The ID of the vault where the exported archive should be saved |
| schedule | false | string | Whether to run the job immediately or in the background (either 'synchronous' or 'asynchronous') |

#### Response

```json
{
  "type": "object",
  "description": "Export Configuration",
  "properties": {
    "startDate": {
      "type": "object",
      "description": "Only include objects whose modification date is after this time (epoch millis). This is used for partial or rolling exports."
    },
    "endDate": {
      "type": "object",
      "description": "Only include objects whose modification date is before this time (epoch millis). This is used for partial or rolling exports."
    },
    "startChangeset": {
      "type": "string",
      "description": "Only include data that is relevant to changesets at or beyond the specified changeset."
    },
    "endChangeset": {
      "type": "string",
      "description": "Only include data that is relevant to changesets at or before the specified changeset."
    },
    "includeACLs": {
      "type": "boolean",
      "default": true,
      "description": "Whether to include ACLs during export."
    },
    "includeTeams": {
      "type": "boolean",
      "default": true,
      "description": "Whether to include Teams during export."
    },
    "includeActivities": {
      "type": "boolean",
      "default": true,
      "description": "Whether to include Activities during export."
    },
    "includeBinaries": {
      "type": "boolean",
      "default": true,
      "description": "Whether to include Binaries for data stores during export."
    },
    "includeAttachments": {
      "type": "boolean",
      "default": true,
      "description": "Whether to include Attachments for Attachables during export."
    },
    "artifactDependencies": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "artifactIncludes": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "forceIncludes": {
      "type": "boolean"
    }
  }
}
```

### <a id="post-domains-domainid-connections-finduser"></a>Finduser Connections

POST /domains/{domainId}/connections/finduser

#### Parameters

| Name | Required | Type | Description |
| --- | --- | --- | --- |
| domainId | true | string | The ID of the domain |
| providerId | true | string |  |
| providerUserId | true | string |  |

### <a id="post-directories-directoryid-connections-connectionid-authorities-authorityid-grant"></a>Grant Authority

Grants an authority against the specified connection to a given user

POST /directories/{directoryId}/connections/{connectionId}/authorities/{authorityId}/grant

#### Parameters

| Name | Required | Type | Description |
| --- | --- | --- | --- |
| directoryId | true | string | The ID of the directory |
| connectionId | true | string | The ID of the connection |
| authorityId | true | string | The ID or authority key for the authority |
| id | true | string |  |

#### Response

```json
{
  "type": "object",
  "description": "Status of Operation",
  "properties": {
    "ok": {
      "type": "boolean",
      "description": "Indicates whether the operation succeeded or not"
    }
  }
}
```

### <a id="post-directories-directoryid-connections-connectionid-import"></a>Import Social Connection

Starts an import job for this resource

POST /directories/{directoryId}/connections/{connectionId}/import

#### Parameters

| Name | Required | Type | Description |
| --- | --- | --- | --- |
| directoryId | true | string | The ID of the directory |
| connectionId | true | string | The ID of the connection |
| groupId | false | string | The Group ID to be assigned to the exported archive |
| artifactId | false | string | The Artifact ID to be assigned to the exported archive |
| versionId | false | string | The Version ID to be assigned to the exported archive |
| vaultId | false | string | The ID of the vault where the exported archive should be saved |
| schedule | false | string | Whether to run the job immediately or in the background (either 'synchronous' or 'asynchronous') |

#### Response

```json
{
  "type": "object",
  "description": "Import Configuration",
  "properties": {
    "includeACLs": {
      "type": "boolean",
      "default": true,
      "description": "Whether to include ACLs during import."
    },
    "includeTeams": {
      "type": "boolean",
      "default": true,
      "description": "Whether to include Teams during import."
    },
    "includeActivities": {
      "type": "boolean",
      "default": true,
      "description": "Whether to include Activities during import."
    },
    "includeBinaries": {
      "type": "boolean",
      "default": true,
      "description": "Whether to include Binaries for data stores during import."
    },
    "includeAttachments": {
      "type": "boolean",
      "default": true,
      "description": "Whether to include Attachments for Attachables during import."
    },
    "strategy": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": "CLONE",
      "description": "Either CLONE or COPY_EVERYTHING. Use CLONE to keep the same IDs on import. Use COPY_EVERYTHING to generate all new IDs for all entries on every import."
    },
    "substitutions": {
      "type": "string"
    }
  }
}
```

### <a id="get-directories-directoryid-identities-identityid-connections"></a>List Connections

GET /directories/{directoryId}/identities/{identityId}/connections

#### Parameters

| Name | Required | Type | Description |
| --- | --- | --- | --- |
| directoryId | true | string | The ID of the directory |
| identityId | true | string | The ID of the identity |

### <a id="get-directories-directoryid-connections"></a>Lists Social Connection

Retrieves a list of Social Connection instances

GET /directories/{directoryId}/connections

#### Parameters

| Name | Required | Type | Description |
| --- | --- | --- | --- |
| directoryId | true | string | The ID of the directory |
| sort | false | object | Defines how to sort fields in the result set |
| skip | false | number | Skips the result set cursor ahead the specified number of records |
| limit | false | number | Specifies the number of records to be handed back in the result set |

This method supports pagination.

#### Response

```json
{
  "type": "object",
  "description": "Result Map",
  "properties": {
    "total_rows": {
      "type": "number"
    },
    "offset": {
      "type": "number"
    },
    "size": {
      "type": "number"
    },
    "rows": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/resultmap_connection"
      }
    }
  }
}
```

### <a id="post-directories-directoryid-connections-query"></a>Queries for Social Connection

Queries for instances of type Social Connection

POST /directories/{directoryId}/connections/query

#### Parameters

| Name | Required | Type | Description |
| --- | --- | --- | --- |
| directoryId | true | string | The ID of the directory |
| sort | false | object | Defines how to sort fields in the result set |
| skip | false | number | Skips the result set cursor ahead the specified number of records |
| limit | false | number | Specifies the number of records to be handed back in the result set |

This method supports pagination.

#### Response

```json
{
  "type": "object",
  "description": "Result Map",
  "properties": {
    "total_rows": {
      "type": "number"
    },
    "offset": {
      "type": "number"
    },
    "size": {
      "type": "number"
    },
    "rows": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/resultmap_connection"
      }
    }
  }
}
```

### <a id="get-directories-directoryid-connections-connectionid-acl-list"></a>Read ACL

Read the Access Control List for the specified connection

GET /directories/{directoryId}/connections/{connectionId}/acl/list

#### Parameters

| Name | Required | Type | Description |
| --- | --- | --- | --- |
| directoryId | true | string | The ID of the directory |
| connectionId | true | string | The ID of the connection |

#### Response

```json
{
  "type": "object",
  "description": "Result Map of ACL entries",
  "properties": {
    "total_rows": {
      "type": "number"
    },
    "offset": {
      "type": "number"
    },
    "size": {
      "type": "number"
    },
    "rows": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "_doc": {
            "type": "string",
            "title": "Principal ID"
          },
          "name": {
            "type": "string",
            "title": "Principal Name"
          },
          "type": {
            "type": "string",
            "title": "Principal Type"
          },
          "domainId": {
            "type": "string"
          },
          "domainQualifiedId": {
            "type": "string"
          },
          "domainQualifiedName": {
            "type": "string"
          },
          "principalId": {
            "type": "string",
            "title": "Principal ID"
          },
          "userEmail": {
            "type": "string"
          },
          "userFirstName": {
            "type": "string"
          },
          "userLastName": {
            "type": "string"
          },
          "authorities": {
            "type": "array",
            "title": "Authorities",
            "items": {
              "type": "string",
              "title": "Authority Key"
            }
          }
        }
      }
    }
  }
}
```

### <a id="get-directories-directoryid-connections-connectionid-acl"></a>Read ACL for Principal

Reads the ACL for a connection and specific actor

GET /directories/{directoryId}/connections/{connectionId}/acl

#### Parameters

| Name | Required | Type | Description |
| --- | --- | --- | --- |
| directoryId | true | string | The ID of the directory |
| connectionId | true | string | The ID of the connection |
| id | true | string |  |

#### Response

```json
{
  "type": "object",
  "description": "Result Map of Authority Keys",
  "properties": {
    "total_rows": {
      "type": "number"
    },
    "offset": {
      "type": "number"
    },
    "size": {
      "type": "number"
    },
    "rows": {
      "type": "array",
      "items": {
        "type": "string",
        "description": "Authority Key"
      }
    }
  }
}
```

### <a id="post-directories-directoryid-connections-connectionid-authorities"></a>Read Authorities Report

Read the Authorities Report for the specified connection

POST /directories/{directoryId}/connections/{connectionId}/authorities

#### Parameters

| Name | Required | Type | Description |
| --- | --- | --- | --- |
| directoryId | true | string | The ID of the directory |
| connectionId | true | string | The ID of the connection |

#### Response

```json
{
  "type": "object",
  "description": "Authority Report",
  "properties": {
    "principalId": {
      "type": "object",
      "properties": {
        "id": {
          "type": "object",
          "properties": {
            "role-key": {
              "type": "string"
            },
            "principal": {
              "type": "string"
            },
            "permissioned": {
              "type": "string"
            },
            "inheritsFrom": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "principal": {
                  "type": "string"
                },
                "permissioned": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}
```

### <a id="get-directories-directoryid-connections-connectionid"></a>Read Social Connection

Reads an instance of a Social Connection

GET /directories/{directoryId}/connections/{connectionId}

#### Parameters

| Name | Required | Type | Description |
| --- | --- | --- | --- |
| directoryId | true | string | The ID of the directory |
| connectionId | true | string | The ID of the connection |

#### Response

```json
{
  "type": "object",
  "extends": "document",
  "container": "directory",
  "description": "Social Connection",
  "properties": {
    "identity-id": {
      "type": "string"
    },
    "providerUserId": {
      "type": "string"
    },
    "providerId": {
      "type": "string"
    },
    "displayName": {
      "type": "string"
    },
    "profileUrl": {
      "type": "string"
    },
    "imageUrl": {
      "type": "string"
    },
    "accessToken": {
      "type": "string"
    },
    "secret": {
      "type": "string"
    },
    "refreshToken": {
      "type": "string"
    },
    "expireTime": {
      "type": "string"
    },
    "_doc": null,
    "_system": null
  }
}
```

### <a id="post-directories-directoryid-connections-connectionid-authorities-authorityid-revoke"></a>Revoke Authority

Revokes an authority against the specified connection from a given user

POST /directories/{directoryId}/connections/{connectionId}/authorities/{authorityId}/revoke

#### Parameters

| Name | Required | Type | Description |
| --- | --- | --- | --- |
| directoryId | true | string | The ID of the directory |
| connectionId | true | string | The ID of the connection |
| authorityId | true | string | The ID or authority key for the authority |
| id | true | string |  |

#### Response

```json
{
  "type": "object",
  "description": "Status of Operation",
  "properties": {
    "ok": {
      "type": "boolean",
      "description": "Indicates whether the operation succeeded or not"
    }
  }
}
```

### <a id="post-domains-domainid-connections-sync"></a>Sync Connections

POST /domains/{domainId}/connections/sync

#### Parameters

| Name | Required | Type | Description |
| --- | --- | --- | --- |
| domainId | true | string | The ID of the domain |
| providerId | true | string |  |
| providerUserId | true | string |  |
| autoCreate | false | string |  |

### <a id="put-directories-directoryid-connections-connectionid"></a>Update Social Connection

Updates an existing Social Connection

PUT /directories/{directoryId}/connections/{connectionId}

#### Parameters

| Name | Required | Type | Description |
| --- | --- | --- | --- |
| directoryId | true | string | The ID of the directory |
| connectionId | true | string | The ID of the connection |

#### Response

```json
{
  "type": "object",
  "description": "Status of Operation",
  "properties": {
    "ok": {
      "type": "boolean",
      "description": "Indicates whether the operation succeeded or not"
    }
  }
}
```

## <a id="schema"></a>Schema

```json

{
  "type": "object",
  "extends": "document",
  "container": "directory",
  "description": "Social Connection",
  "properties": {
    "identity-id": {
      "type": "string"
    },
    "providerUserId": {
      "type": "string"
    },
    "providerId": {
      "type": "string"
    },
    "displayName": {
      "type": "string"
    },
    "profileUrl": {
      "type": "string"
    },
    "imageUrl": {
      "type": "string"
    },
    "accessToken": {
      "type": "string"
    },
    "secret": {
      "type": "string"
    },
    "refreshToken": {
      "type": "string"
    },
    "expireTime": {
      "type": "string"
    },
    "_doc": null,
    "_system": null
  },
  "id": "connection"
}
```
