> For AI agents: [llms.txt](https://docs.trustedauth.com/llms.txt) provides a Markdown index of this documentation.

# List directory attribute mappings

`GET /api/web/v1/directories/{id}/attributemappings`

List all directory attribute mappings for a given directory. Caller requires the DIRECTORIES:VIEW permission.

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| id | path | Yes | string | The UUID of the directory whose directory attribute mappings are to be returned. |

## Responses

### 200

Successful

#### application/json

Schema

```json
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "directoryAttributeName": {
        "type": "string",
        "description": "The name of the directory attribute being mapped.",
        "example": "givenName"
      },
      "directoryId": {
        "type": "string",
        "description": "The UUID of the Directory the attribute mapping belongs to.",
        "example": "6781549d-433c-44ea-a42f-4705c26f3245"
      },
      "id": {
        "type": "string",
        "description": "The UUID of the attribute mapping.",
        "example": "6781549d-433c-44ea-a42f-4705c26f3245"
      },
      "userAttribute": {
        "required": [
          "mandatory",
          "name",
          "systemDefined",
          "unique"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The UUID for this user attribute.  Generated when the user attribute is created."
          },
          "mandatory": {
            "type": "boolean",
            "description": "A flag indicating if users must have a value for this user attribute."
          },
          "name": {
            "type": "string",
            "description": "The name of this user attribute."
          },
          "systemDefined": {
            "type": "boolean",
            "description": "A flag indicating if this user attribute is one of the system defined user attributes."
          },
          "type": {
            "type": "string",
            "description": "Type of user attribute. Currently only used to specify the type of contact if the attribute is to be used for OTP delivery.",
            "example": "OTP_EMAIL",
            "enum": [
              "NONE",
              "OTP_EMAIL",
              "OTP_SMS",
              "OTP_VOICE",
              "OTP_WECHAT",
              "OTP_WHATSAPP"
            ]
          },
          "unique": {
            "type": "boolean",
            "description": "A flag indicating if this attribute is intended to be unique."
          }
        },
        "description": "Information about user attribute definitions.",
        "title": "UserAttribute"
      },
      "userAttributeId": {
        "type": "string",
        "description": "The UUID of the Identity as a Service User Attribute being mapped to.",
        "example": "6781549d-433c-44ea-a42f-4705c26f3245"
      }
    },
    "description": "A DirectoryAttributeMapping defines the information returned about a directory attribute mapping. A directory attribute mapping specifies which directory attribute values are mapped into which Identity as a Service user attributes.",
    "title": "DirectoryAttributeMapping"
  }
}
```

### 400

Bad Request

#### application/json

Schema

```json
{
  "type": "object",
  "properties": {
    "errorCode": {
      "type": "string",
      "description": "Error Codes specific to cause of failure.",
      "example": "invalid_user_response"
    },
    "errorMessage": {
      "type": "string",
      "description": "Additional Error Message describing the error.",
      "example": "Application id cannot be null"
    },
    "parameters": {
      "type": "array",
      "description": "Optional additional error information.",
      "items": {
        "type": "object",
        "description": "Optional additional error information."
      }
    }
  },
  "description": "Object containing information about errors reported by services.",
  "title": "ErrorInfo"
}
```

### 401

Access denied

#### application/json

Schema

```json
{
  "type": "object",
  "properties": {
    "errorCode": {
      "type": "string",
      "description": "Error Codes specific to cause of failure.",
      "example": "invalid_user_response"
    },
    "errorMessage": {
      "type": "string",
      "description": "Additional Error Message describing the error.",
      "example": "Application id cannot be null"
    },
    "parameters": {
      "type": "array",
      "description": "Optional additional error information.",
      "items": {
        "type": "object",
        "description": "Optional additional error information."
      }
    }
  },
  "description": "Object containing information about errors reported by services.",
  "title": "ErrorInfo"
}
```

### 403

Forbidden

#### application/json

Schema

```json
{
  "type": "object",
  "properties": {
    "errorCode": {
      "type": "string",
      "description": "Error Codes specific to cause of failure.",
      "example": "invalid_user_response"
    },
    "errorMessage": {
      "type": "string",
      "description": "Additional Error Message describing the error.",
      "example": "Application id cannot be null"
    },
    "parameters": {
      "type": "array",
      "description": "Optional additional error information.",
      "items": {
        "type": "object",
        "description": "Optional additional error information."
      }
    }
  },
  "description": "Object containing information about errors reported by services.",
  "title": "ErrorInfo"
}
```

### 404

Not Found

#### application/json

Schema

```json
{
  "type": "object",
  "properties": {
    "errorCode": {
      "type": "string",
      "description": "Error Codes specific to cause of failure.",
      "example": "invalid_user_response"
    },
    "errorMessage": {
      "type": "string",
      "description": "Additional Error Message describing the error.",
      "example": "Application id cannot be null"
    },
    "parameters": {
      "type": "array",
      "description": "Optional additional error information.",
      "items": {
        "type": "object",
        "description": "Optional additional error information."
      }
    }
  },
  "description": "Object containing information about errors reported by services.",
  "title": "ErrorInfo"
}
```

### 409

Conflict

#### application/json

Schema

```json
{
  "type": "object",
  "properties": {
    "errorCode": {
      "type": "string",
      "description": "Error Codes specific to cause of failure.",
      "example": "invalid_user_response"
    },
    "errorMessage": {
      "type": "string",
      "description": "Additional Error Message describing the error.",
      "example": "Application id cannot be null"
    },
    "parameters": {
      "type": "array",
      "description": "Optional additional error information.",
      "items": {
        "type": "object",
        "description": "Optional additional error information."
      }
    }
  },
  "description": "Object containing information about errors reported by services.",
  "title": "ErrorInfo"
}
```

## Security

Requirements

```json
[
  {
    "AdminAPIAuthentication": [
      "DIRECTORIES:VIEW"
    ]
  }
]
```
