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

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

        await client.DeviceCredentials.CreatePublicKeyAsync(
            new CreatePublicKeyDeviceCredentialRequestContent {
                DeviceName = "device_name",
                Type = "public_key",
                Value = "value",
                DeviceId = "device_id"
            }
        );
    }

}
{
  "id": "dcr_0000000000000001"
}

Authorizations

Authorization
string
header
required

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

Body

device_name
string
required

Name for this device easily recognized by owner.

Minimum string length: 1
type
enum<string>
required

Type of credential. Must be public_key.

Available options:
public_key
value
string
required

Base64 encoded string containing the credential.

Minimum string length: 1
device_id
string
required

Unique identifier for the device. Recommend using Android_ID on Android and identifierForVendor.

Maximum string length: 36
Pattern: ^[-A-Fa-f0-9]+$
client_id
string<client-id>

client_id of the client (application) this credential is for.

Response

Device credentials successfully created.

id
string
default:dcr_0000000000000001
required

The credential's identifier