Skip to main content
POST
https://{tenantDomain}/api/v2
/
token-exchange-profiles
C#
using Auth0.ManagementApi;
using System.Threading.Tasks;

public partial class Examples
{
    public async Task Example() {
        var client = new ManagementClient(
            token: "<token>"
        );

        await client.TokenExchangeProfiles.CreateAsync(
            new CreateTokenExchangeProfileRequestContent {
                Name = "name",
                SubjectTokenType = "subject_token_type",
                ActionId = "action_id",
                Type = "custom_authentication"
            }
        );
    }

}
{
  "id": "<string>",
  "name": "Token Exchange Profile 1",
  "subject_token_type": "<string>",
  "action_id": "<string>",
  "type": "custom_authentication",
  "created_at": "2024-01-01T00:00:00.000Z",
  "updated_at": "2024-01-01T00:00:00.000Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

name
string
default:Token Exchange Profile 1
required

Friendly name of this profile.

Required string length: 3 - 50
subject_token_type
string<url>
required

Subject token type for this profile. When receiving a token exchange request on the Authentication API, the corresponding token exchange profile with a matching subject_token_type will be executed. This must be a URI.

Required string length: 8 - 100
action_id
string
required

The ID of the Custom Token Exchange action to execute for this profile, in order to validate the subject_token. The action must use the custom-token-exchange trigger.

Required string length: 1 - 36
type
enum<string>
required

The type of the profile, which controls how the profile will be executed when receiving a token exchange request.

Available options:
custom_authentication
Required string length: 1 - 21

Response

Token exchange profile successfully created.

id
string<token-exchange-profile-id>

The unique ID of the token exchange profile.

name
string
default:Token Exchange Profile 1

Friendly name of this profile.

Required string length: 3 - 50
subject_token_type
string<url>

Subject token type for this profile. When receiving a token exchange request on the Authentication API, the corresponding token exchange profile with a matching subject_token_type will be executed. This must be a URI.

Required string length: 8 - 100
action_id
string

The ID of the Custom Token Exchange action to execute for this profile, in order to validate the subject_token. The action must use the custom-token-exchange trigger.

Required string length: 1 - 36
type
enum<string>

The type of the profile, which controls how the profile will be executed when receiving a token exchange request.

Available options:
custom_authentication
Required string length: 1 - 21
created_at
string<date-time>
default:2024-01-01T00:00:00.000Z

The time when this profile was created.

updated_at
string<date-time>
default:2024-01-01T00:00:00.000Z

The time when this profile was updated.