---
descriptions:
  directory:
    self: 'The [Directory](/reference/directory-sync/directory) object.'
    object: Distinguishes the Directory object.
    id: Unique identifier for the Directory.
    domain: The URL associated with an Enterprise Client.
    external_key: External Key for the Directory.
    name: The name of the directory.
    organization_id: The unique identifier for the Organization in which the directory resides.
    state:
      lowercase: >
        Describes whether the Directory has been successfully connected to an
        external provider.

        The states `linked` and `unlinked` are equivalent to the Directory
        states `active`

        and `inactive` respectively in webhooks.

        - `linked`

        - `unlinked`

        - `validating`

        - `deleting`

        - `invalid_credentials`
      lowercaseNormalized: >
        Describes whether the Directory has been successfully connected to an
        external provider.

        - `active`

        - `inactive`

        - `validating`

        - `deleting`

        - `invalid_credentials`
      titlecase: >
        Describes whether the Directory has been successfully connected to an
        external provider.

        The states `linked` and `unlinked` are equivalent to the Directory
        states `active`

        and `inactive` respectively in webhooks.

        - `Active`

        - `Validating`

        - `Inactive`

        - `Deleting`

        - `InvalidCredentials`

        - `Linked`

        - `Unlinked`
    type:
      lowercase: |
        The type of external Directory Provider integrated with.
        - `azure scim v2.0`
        - `bamboohr`
        - `breathe hr`
        - `cezanne hr`
        - `generic scim v2.0`
        - `gsuite directory`
        - `jump cloud scim v2.0`
        - `okta scim v2.0`
        - `onelogin scim v2.0`
        - `people hr`
        - `pingfederate scim v2.0`
        - `workday`
      titlecase: |
        The type of external Directory Provider integrated with.
        - `AzureSCIMV2_0`
        - `BambooHr`
        - `BreatheHr`
        - `Cezanne HR`
        - `CyberarkSCIMV2_0`
        - `FourthHr`
        - `GenericSCIMV2_0`
        - `GSuiteDirectory`
        - `Gusto`
        - `Hibob`
        - `JumpCloudSCIM2_0`
        - `OktaSCIMV2_0`
        - `OneLoginSCIMV2_0`
        - `PeopleHR`
        - `PingFederateSCIMV2_0`
        - `Rippling`
        - `Workday`
    created_at: The timestamp when the Directory was created.
    updated_at: The timestamp when the Directory was last updated.
reference:
  curl:
    - url: /reference/directory-sync/directory
      key: directory
      id: directory
      title: directory
      properties:
        - key: id
          type: string
          description: (directory.id)
        - key: domain
          type: string
          description: (directory.domain)
        - key: name
          type: string
          description: (directory.name)
        - key: organization_id
          optional: true
          type: string
          description: (directory.organization_id)
        - key: state
          type: enum
          description: (directory.state.lowercase)
        - key: type
          type: enum
          description: (directory.type.lowercase)
        - key: created_at
          type: string
          description: (directory.created_at)
        - key: updated_at
          type: string
          description: (directory.updated_at)
  dotnet:
    - url: /reference/directory-sync/directory
      key: Directory
      id: directory
      title: class Directory
      properties:
        - key: Object
          type: '"directory"'
          description: (directory.object)
        - key: Id
          type: string
          description: (directory.id)
        - key: Domain
          type: string
          description: (directory.domain)
        - key: Name
          type: string
          description: (directory.name)
        - key: OrganizationId
          optional: true
          type: string
          description: (directory.organization_id)
        - key: State
          type: string
          description: (directory.state.lowercase)
        - key: Type
          type: string
          description: (directory.type.lowercase)
        - key: CreatedAt
          type: string
          description: (directory.created_at)
        - key: UpdatedAt
          type: string
          description: (directory.updated_at)
  ruby:
    - url: /reference/directory-sync/directory
      key: Directory
      id: directory
      title: class Directory
      properties:
        - key: id
          type: String
          description: (directory.id)
        - key: domain
          type: String
          description: (directory.domain)
        - key: name
          type: String
          description: (directory.name)
        - key: organization_id
          optional: true
          type: String
          description: (directory.organization_id)
        - key: state
          type: String
          description: (directory.state.lowercase)
        - key: type
          type: String
          description: (directory.type.lowercase)
        - key: created_at
          type: String
          description: (directory.created_at)
        - key: updated_at
          type: String
          description: (directory.updated_at)
  python:
    - url: /reference/directory-sync/directory
      key: Directory
      id: directory
      title: Directory
      properties:
        - key: object
          type: '"directory"'
          description: (directory.id)
        - key: id
          type: str
          description: (directory.id)
        - key: domain
          type: str
          description: (directory.domain)
        - key: name
          type: str
          description: (directory.name)
        - key: organization_id
          optional: true
          type: str
          description: (directory.organization_id)
        - key: state
          type: str
          description: (directory.state.lowercase)
        - key: type
          type: str
          description: (directory.type.lowercase)
        - key: created_at
          type: str
          description: (directory.created_at)
        - key: updated_at
          type: str
          description: (directory.updated_at)
  js:
    - url: /reference/directory-sync/directory
      key: Directory
      id: directory
      title: interface Directory
      properties:
        - key: object
          type: '"directory"'
          description: (directory.object)
        - key: id
          type: string
          description: (directory.id)
        - key: domain
          type: string
          description: (directory.domain)
        - key: externalKey
          type: string
          description: (directory.external_key)
        - key: name
          type: string
          description: (directory.name)
        - key: organizationId
          optional: true
          type: string
          description: (directory.organization_id)
        - key: state
          type: DirectoryState
          description: (directory.state.lowercaseNormalized)
        - key: type
          type: string
          description: (directory.type.lowercase)
        - key: createdAt
          type: string
          description: (directory.created_at)
        - key: updatedAt
          type: string
          description: (directory.updated_at)
  go:
    - url: /reference/directory-sync/directory
      key: Directory
      id: directory
      title: directorysync.Directory
      properties:
        - key: ID
          type: string
          description: (directory.id)
        - key: Domain
          type: string
          description: (directory.domain)
        - key: ExternalKey
          type: string
          description: (directory.external_key)
        - key: Name
          type: string
          description: (directory.name)
        - key: OrganizationID
          optional: true
          type: string
          description: (directory.organization_id)
        - key: State
          type: directorysync.DirectoryState
          description: (directory.state.lowercase)
        - key: Type
          type: directorysync.DirectoryType
          description: (directory.type.lowercase)
        - key: CreatedAt
          type: string
          description: (directory.created_at)
        - key: UpdatedAt
          type: string
          description: (directory.updated_at)
  php:
    - url: /reference/directory-sync/directory
      key: Directory
      id: directory
      title: WorkOS\Resource\Directory
      properties:
        - key: id
          type: string
          description: (directory.id)
        - key: domain
          type: string
          description: (directory.domain)
        - key: name
          type: string
          description: (directory.name)
        - key: organizationId
          optional: true
          type: string
          description: (directory.organization_id)
        - key: state
          type: string
          description: (directory.state.lowercase)
        - key: type
          type: string
          description: (directory.type.lowercase)
        - key: createdAt
          type: string
          description: (directory.created_at)
        - key: updatedAt
          type: string
          description: (directory.updated_at)
  java:
    - url: /reference/directory-sync/directory
      key: Directory
      id: directory
      title: class Directory
      properties:
        - key: obj
          type: '"directory"'
          description: (directory.object)
        - key: id
          type: String
          description: (directory.id)
        - key: name
          type: String
          description: (directory.name)
        - key: domain
          optional: true
          type: String
          description: (directory.domain)
        - key: externalKey
          type: String
          optional: true
          description: (directory.external_key)
        - key: organizationId
          optional: true
          type: String
          description: (directory.organization_id)
        - key: state
          type: DirectoryState
          description: (directory.state.titlecase)
        - key: type
          type: DirectoryType
          description: (directory.type.titlecase)
        - key: createdAt
          type: String
          description: (directory.created_at)
        - key: updatedAt
          type: String
          description: (directory.updated_at)
originalPath: >-
  .tmp-workos-clone/packages/docs/content/reference/directory-sync/directory/index.mdx
---

# Directory

A directory stores information about an organization's employee management system.

Synchronizing with a directory enables you to receive changes to an organization’s [user](/reference/directory-sync/directory-user) and [group](/reference/directory-sync/directory-group) structure.

Directory providers vary in implementation details and may require different sets of fields for integration, such as API keys, subdomains, endpoints, usernames, etc. Where available, the WorkOS API will provide these fields when fetching directory records.

<CodeBlock title="Example Directory" file="directory" referenceId="directory" />
