---
title: Mostrar una lista con todos los AuthN Mappings
description: Muestra una lista con todos los AuthN Mappings de la organización.
breadcrumbs: Documentación > API > Mostrar una lista con todos los AuthN Mappings
---

> For the complete documentation index, see [llms.txt](https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/llms.txt).

# Mostrar una lista con todos los AuthN Mappings

## v2 (latest)

| Datadog site      | API endpoint                                            |
| ----------------- | ------------------------------------------------------- |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/authn_mappings     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/authn_mappings |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/authn_mappings |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/authn_mappings      |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/authn_mappings |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/authn_mappings |
| uk1.datadoghq.com | GET https://api.uk1.datadoghq.com/api/v2/authn_mappings |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/authn_mappings      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/authn_mappings  |

### Overview

Muestra una lista con todos los AuthN Mappings de la organización.

This endpoint requires the `user_access_read` permission.

### Arguments

#### Query Strings

| Field         | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                        |
| ------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| page[size]    | integer | Number of items to return per page. The maximum allowed value is 100. Default: `10`.                                                                                                                                                                                                                                                                                                               |
| page[number]  | integer | Specific page number to return. Default: `0`.                                                                                                                                                                                                                                                                                                                                                      |
| sort          | enum    | Sort AuthN Mappings depending on the given field. Allowed enum values: `created_at`, `-created_at`, `role_id`, `-role_id`, `saml_assertion_attribute_id`, `-saml_assertion_attribute_id`, `role.name`, `-role.name`, `saml_assertion_attribute.attribute_key`, `-saml_assertion_attribute.attribute_key`, `saml_assertion_attribute.attribute_value`, `-saml_assertion_attribute.attribute_value`. |
| filter        | string  | Filter all mappings by the given string.                                                                                                                                                                                                                                                                                                                                                           |
| resource_type | enum    | Filter by mapping resource type. Defaults to "role" if not specified. Allowed enum values: `role`, `team`.                                                                                                                                                                                                                                                                                         |

### Response

{% tabs %}
{% tab label="200" %}
OK

{% tabs %}
{% tab label="Model" %}
Array of AuthN Mappings response.

| Parent field                     | Field                            | Type      | Description                                                                                                                                                                                                                                                                                   |
| -------------------------------- | -------------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                                  | data                             | [object]  | Array of returned AuthN Mappings.                                                                                                                                                                                                                                                             |
| data                             | attributes                       | object    | Attributes of AuthN Mapping.                                                                                                                                                                                                                                                                  |
| attributes                       | attribute_key                    | string    | Key portion of a key/value pair of the attribute sent from the Identity Provider.                                                                                                                                                                                                             |
| attributes                       | attribute_value                  | string    | Value portion of a key/value pair of the attribute sent from the Identity Provider.                                                                                                                                                                                                           |
| attributes                       | created_at                       | date-time | Creation time of the AuthN Mapping. Read-only.                                                                                                                                                                                                                                                |
| attributes                       | modified_at                      | date-time | Time of last AuthN Mapping modification. Read-only.                                                                                                                                                                                                                                           |
| attributes                       | saml_assertion_attribute_id      | string    | The ID of the SAML assertion attribute.                                                                                                                                                                                                                                                       |
| data                             | id [*required*]                  | string    | ID of the AuthN Mapping.                                                                                                                                                                                                                                                                      |
| data                             | relationships                    | object    | All relationships associated with AuthN Mapping.                                                                                                                                                                                                                                              |
| relationships                    | role                             | object    | Relationship to role.                                                                                                                                                                                                                                                                         |
| role                             | data                             | object    | Relationship to role object.                                                                                                                                                                                                                                                                  |
| data                             | id                               | string    | The unique identifier of the role.                                                                                                                                                                                                                                                            |
| data                             | type                             | enum      | Roles type. Allowed enum values: `roles`. Default: `roles`.                                                                                                                                                                                                                                   |
| relationships                    | saml_assertion_attribute         | object    | AuthN Mapping relationship to SAML Assertion Attribute.                                                                                                                                                                                                                                       |
| saml_assertion_attribute         | data [*required*]                | object    | Data of AuthN Mapping relationship to SAML Assertion Attribute.                                                                                                                                                                                                                               |
| data                             | id [*required*]                  | string    | The ID of the SAML assertion attribute.                                                                                                                                                                                                                                                       |
| data                             | type [*required*]                | enum      | SAML assertion attributes resource type. Allowed enum values: `saml_assertion_attributes`. Default: `saml_assertion_attributes`.                                                                                                                                                              |
| relationships                    | team                             | object    | Relationship to team.                                                                                                                                                                                                                                                                         |
| team                             | data                             | object    | Relationship to Team object.                                                                                                                                                                                                                                                                  |
| data                             | id                               | string    | The unique identifier of the team.                                                                                                                                                                                                                                                            |
| data                             | type                             | enum      | Team type Allowed enum values: `team`. Default: `team`.                                                                                                                                                                                                                                       |
| data                             | type [*required*]                | enum      | AuthN Mappings resource type. Allowed enum values: `authn_mappings`. Default: `authn_mappings`.                                                                                                                                                                                               |
|                                  | included                         | [<oneOf>] | Included data in the AuthN Mapping response.                                                                                                                                                                                                                                                  |
| included                         | <type=saml_assertion_attributes> | object    | SAML assertion attribute.                                                                                                                                                                                                                                                                     |
| <type=saml_assertion_attributes> | attributes                       | object    | Key/Value pair of attributes used in SAML assertion attributes.                                                                                                                                                                                                                               |
| attributes                       | attribute_key                    | string    | Key portion of a key/value pair of the attribute sent from the Identity Provider.                                                                                                                                                                                                             |
| attributes                       | attribute_value                  | string    | Value portion of a key/value pair of the attribute sent from the Identity Provider.                                                                                                                                                                                                           |
| <type=saml_assertion_attributes> | id [*required*]                  | string    | The ID of the SAML assertion attribute.                                                                                                                                                                                                                                                       |
| <type=saml_assertion_attributes> | type [*required*]                | enum      | SAML assertion attributes resource type. Allowed enum values: `saml_assertion_attributes`. Default: `saml_assertion_attributes`.                                                                                                                                                              |
| included                         | <type=roles>                     | object    | Role object returned by the API.                                                                                                                                                                                                                                                              |
| <type=roles>                     | attributes                       | object    | Attributes of the role.                                                                                                                                                                                                                                                                       |
| attributes                       | created_at                       | date-time | Creation time of the role. Read-only.                                                                                                                                                                                                                                                         |
| attributes                       | modified_at                      | date-time | Time of last role modification. Read-only.                                                                                                                                                                                                                                                    |
| attributes                       | name                             | string    | The name of the role. The name is neither unique nor a stable identifier of the role.                                                                                                                                                                                                         |
| attributes                       | receives_permissions_from        | [string]  | The managed role from which this role automatically inherits new permissions. Specify one of the following: "Datadog Admin Role", "Datadog Standard Role", or "Datadog Read Only Role". If empty or not specified, the role does not automatically inherit permissions from any managed role. |
| attributes                       | user_count                       | int64     | Number of users with that role. Read-only.                                                                                                                                                                                                                                                    |
| <type=roles>                     | id                               | string    | The unique identifier of the role.                                                                                                                                                                                                                                                            |
| <type=roles>                     | relationships                    | object    | Relationships of the role object returned by the API.                                                                                                                                                                                                                                         |
| relationships                    | permissions                      | object    | Relationship to multiple permissions objects.                                                                                                                                                                                                                                                 |
| permissions                      | data                             | [object]  | Relationships to permission objects.                                                                                                                                                                                                                                                          |
| data                             | id                               | string    | ID of the permission.                                                                                                                                                                                                                                                                         |
| data                             | type                             | enum      | Permissions resource type. Allowed enum values: `permissions`. Default: `permissions`.                                                                                                                                                                                                        |
| <type=roles>                     | type [*required*]                | enum      | Roles type. Allowed enum values: `roles`. Default: `roles`.                                                                                                                                                                                                                                   |
| included                         | <type=team>                      | object    | Team.                                                                                                                                                                                                                                                                                         |
| <type=team>                      | attributes                       | object    | Team attributes.                                                                                                                                                                                                                                                                              |
| attributes                       | avatar                           | string    | Unicode representation of the avatar for the team, limited to a single grapheme                                                                                                                                                                                                               |
| attributes                       | banner                           | int64     | Banner selection for the team                                                                                                                                                                                                                                                                 |
| attributes                       | handle                           | string    | The team's identifier                                                                                                                                                                                                                                                                         |
| attributes                       | link_count                       | int32     | The number of links belonging to the team Read-only.                                                                                                                                                                                                                                          |
| attributes                       | name                             | string    | The name of the team                                                                                                                                                                                                                                                                          |
| attributes                       | summary                          | string    | A brief summary of the team, derived from the `description`                                                                                                                                                                                                                                   |
| attributes                       | user_count                       | int32     | The number of users belonging to the team Read-only.                                                                                                                                                                                                                                          |
| <type=team>                      | id                               | string    | The ID of the Team.                                                                                                                                                                                                                                                                           |
| <type=team>                      | type                             | enum      | Team type Allowed enum values: `team`. Default: `team`.                                                                                                                                                                                                                                       |
|                                  | meta                             | object    | Object describing meta attributes of response.                                                                                                                                                                                                                                                |
| meta                             | page                             | object    | Pagination object.                                                                                                                                                                                                                                                                            |
| page                             | total_count                      | int64     | Total count.                                                                                                                                                                                                                                                                                  |
| page                             | total_filtered_count             | int64     | Total count of elements matched by the filter.                                                                                                                                                                                                                                                |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": [
    {
      "attributes": {
        "attribute_key": "member-of",
        "attribute_value": "Development",
        "created_at": "2019-09-19T10:00:00.000Z",
        "modified_at": "2019-09-19T10:00:00.000Z",
        "saml_assertion_attribute_id": "0"
      },
      "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
      "relationships": {
        "role": {
          "data": {
            "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
            "type": "roles"
          }
        },
        "saml_assertion_attribute": {
          "data": {
            "id": "0",
            "type": "saml_assertion_attributes"
          }
        },
        "team": {
          "data": {
            "id": "f9bb8444-af7f-11ec-ac2c-da7ad0900001",
            "type": "team"
          }
        }
      },
      "type": "authn_mappings"
    }
  ],
  "included": [
    {
      "attributes": {
        "attribute_key": "member-of",
        "attribute_value": "Development"
      },
      "id": "0",
      "type": "saml_assertion_attributes"
    }
  ],
  "meta": {
    "page": {
      "total_count": "integer",
      "total_filtered_count": "integer"
    }
  }
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="403" %}
Authentication Error

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="429" %}
Too many requests

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}
{% /tabs %}

### Code Example

{% tabs %}
{% tab label="Curl" %}
```bash
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com" # Or us3.datadoghq.com, us5.datadoghq.com, datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com, ddog-gov.com, us2.ddog-gov.com
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/authn_mappings" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
```
{% /tab %}

{% tab label="Go" %}
```go
// List all AuthN Mappings returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	ctx = context.WithValue(ctx, datadog.ContextAccessToken, os.Getenv("DD_BEARER_TOKEN"))
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewAuthNMappingsApi(apiClient)
	resp, r, err := api.ListAuthNMappings(ctx, *datadogV2.NewListAuthNMappingsOptionalParameters())

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AuthNMappingsApi.ListAuthNMappings`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `AuthNMappingsApi.ListAuthNMappings`:\n%s\n", responseContent)
}
```

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=go) and then save the example to `main.go` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"
```
{% /tab %}

{% tab label="Java" %}
```java
// List all AuthN Mappings returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.AuthNMappingsApi;
import com.datadog.api.client.v2.model.AuthNMappingsResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
    AuthNMappingsApi apiInstance = new AuthNMappingsApi(defaultClient);

    try {
      AuthNMappingsResponse result = apiInstance.listAuthNMappings();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling AuthNMappingsApi#listAuthNMappings");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=java) and then save the example to `Example.java` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"
```
{% /tab %}

{% tab label="Python" %}
```python
"""
List all AuthN Mappings returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.authn_mappings_api import AuthNMappingsApi

configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
with ApiClient(configuration) as api_client:
    api_instance = AuthNMappingsApi(api_client)
    response = api_instance.list_authn_mappings()

    print(response)
```

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=python) and then save the example to `example.py` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"
```
{% /tab %}

{% tab label="Ruby" %}
```ruby
# List all AuthN Mappings returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.access_token = ENV["DD_BEARER_TOKEN"]
end
api_instance = DatadogAPIClient::V2::AuthNMappingsAPI.new
p api_instance.list_authn_mappings()
```

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=ruby) and then save the example to `example.rb` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"
```
{% /tab %}

{% tab label="Rust" %}
```rust
// List all AuthN Mappings returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_authn_mappings::AuthNMappingsAPI;
use datadog_api_client::datadogV2::api_authn_mappings::ListAuthNMappingsOptionalParams;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = AuthNMappingsAPI::with_config(configuration);
    let resp = api
        .list_authn_mappings(ListAuthNMappingsOptionalParams::default())
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=rust) and then save the example to `src/main.rs` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run
```
{% /tab %}

{% tab label="TypeScript" %}
```typescript
/**
 * List all AuthN Mappings returns "OK" response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration({
  authMethods: {
    AuthZ: {
      accessToken: process.env.DD_BEARER_TOKEN as string,
    },
  },
});
const apiInstance = new v2.AuthNMappingsApi(configuration);

apiInstance
  .listAuthNMappings()
  .then((data: v2.AuthNMappingsResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));
```

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=typescript) and then save the example to `example.ts` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"
```
{% /tab %}
{% /tabs %}
