---
title: Activate MFA User Device (PingID Desktop)
component: pingone-api
page_id: pingone-api:mfa:users/mfa-devices/activate-mfa-user-device-desktop
canonical_url: https://developer.pingidentity.com/pingone-api/mfa/users/mfa-devices/activate-mfa-user-device-desktop.html
section_ids:
  headers: Headers
  body: Body
  example-request: Example Request
  example-response: Example Response
---

# Activate MFA User Device (PingID Desktop)

##

   

```none
POST {{apiPath}}/environments/{{envID}}/users/{{userID}}/devices/{{deviceID}}
```

The creation and pairing of a PingID Desktop device involves a sequence of requests and responses, including interaction with the Desktop API

This example shows the final step in this process, sending a POST request to the `devices` endpoint:

`{{apiPath}}/environments/{{envID}}/users/{{userID}}/devices/{{deviceID}}`

`deviceID` in the URL represents the ID that was included in the response from the PingOne server in [the initial device creation request](create-mfa-user-device-desktop.html) .

The body consists of a single field, `attestation`, and its value is the JWT that you received after the call to the PingID Desktop API, described in the description of [the initial device creation request](create-mfa-user-device-desktop.html).

The `Content-Type` header must be set to `application/vnd.pingidentity.device.activate+json`.

> **Collapse: Request Model**
>
> | Property      | Type   | Required? |
> | ------------- | ------ | --------- |
> | `attestation` | String | Required  |
>
> Refer to [PingID Desktop device properties](../mfa-devices.html#pingid-desktop-device-properties) for full property descriptions.

### Headers

Authorization      Bearer {{accessToken}}

Content-Type      application/vnd.pingidentity.device.activate+json

### Body

raw ( application/vnd.pingidentity.device.activate+json )

```json
{
    "attestation":
        "{{attestationValue}}"
}
```

##

### Example Request

* cURL

* C#

* Go

* HTTP

* Java

* jQuery

* NodeJS

* Python

* PHP

* Ruby

* Swift

```shell
curl --location --globoff '{{apiPath}}/environments/{{envID}}/users/{{userID}}/devices/{{deviceID}}' \
--header 'Content-Type: application/vnd.pingidentity.device.activate+json' \
--header 'Authorization: Bearer {{accessToken}}' \
--data '{
    "attestation":
        "{{attestationValue}}"
}'
```

```csharp
var options = new RestClientOptions("{{apiPath}}/environments/{{envID}}/users/{{userID}}/devices/{{deviceID}}")
{
  MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/vnd.pingidentity.device.activate+json");
request.AddHeader("Authorization", "Bearer {{accessToken}}");
var body = @"{   " + "\n" +
@"    ""attestation"": " + "\n" +
@"        ""{{attestationValue}}""" + "\n" +
@"}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
```

```golang
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io"
)

func main() {

  url := "{{apiPath}}/environments/{{envID}}/users/{{userID}}/devices/{{deviceID}}"
  method := "POST"

  payload := strings.NewReader(`{
    "attestation":
        "{{attestationValue}}"
}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/vnd.pingidentity.device.activate+json")
  req.Header.Add("Authorization", "Bearer {{accessToken}}")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := io.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
```

```http
POST /environments/{{envID}}/users/{{userID}}/devices/{{deviceID}} HTTP/1.1
Host: {{apiPath}}
Content-Type: application/vnd.pingidentity.device.activate+json
Authorization: Bearer {{accessToken}}

{
    "attestation":
        "{{attestationValue}}"
}
```

```java
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/vnd.pingidentity.device.activate+json");
RequestBody body = RequestBody.create(mediaType, "{   \n    \"attestation\": \n        \"{{attestationValue}}\"\n}");
Request request = new Request.Builder()
  .url("{{apiPath}}/environments/{{envID}}/users/{{userID}}/devices/{{deviceID}}")
  .method("POST", body)
  .addHeader("Content-Type", "application/vnd.pingidentity.device.activate+json")
  .addHeader("Authorization", "Bearer {{accessToken}}")
  .build();
Response response = client.newCall(request).execute();
```

```javascript
var settings = {
  "url": "{{apiPath}}/environments/{{envID}}/users/{{userID}}/devices/{{deviceID}}",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Content-Type": "application/vnd.pingidentity.device.activate+json",
    "Authorization": "Bearer {{accessToken}}"
  },
  "data": JSON.stringify({
    "attestation": "{{attestationValue}}"
  }),
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
```

```javascript
var request = require('request');
var options = {
  'method': 'POST',
  'url': '{{apiPath}}/environments/{{envID}}/users/{{userID}}/devices/{{deviceID}}',
  'headers': {
    'Content-Type': 'application/vnd.pingidentity.device.activate+json',
    'Authorization': 'Bearer {{accessToken}}'
  },
  body: JSON.stringify({
    "attestation": "{{attestationValue}}"
  })

};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
```

```python
import requests
import json

url = "{{apiPath}}/environments/{{envID}}/users/{{userID}}/devices/{{deviceID}}"

payload = json.dumps({
  "attestation": "{{attestationValue}}"
})
headers = {
  'Content-Type': 'application/vnd.pingidentity.device.activate+json',
  'Authorization': 'Bearer {{accessToken}}'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
```

```php
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiPath}}/environments/{{envID}}/users/{{userID}}/devices/{{deviceID}}');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Content-Type' => 'application/vnd.pingidentity.device.activate+json',
  'Authorization' => 'Bearer {{accessToken}}'
));
$request->setBody('{   \n    "attestation": \n        "{{attestationValue}}"\n}');
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}
```

```ruby
require "uri"
require "json"
require "net/http"

url = URI("{{apiPath}}/environments/{{envID}}/users/{{userID}}/devices/{{deviceID}}")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/vnd.pingidentity.device.activate+json"
request["Authorization"] = "Bearer {{accessToken}}"
request.body = JSON.dump({
  "attestation": "{{attestationValue}}"
})

response = http.request(request)
puts response.read_body
```

```swift
let parameters = "{   \n    \"attestation\": \n        \"{{attestationValue}}\"\n}"
let postData = parameters.data(using: .utf8)

var request = URLRequest(url: URL(string: "{{apiPath}}/environments/{{envID}}/users/{{userID}}/devices/{{deviceID}}")!,timeoutInterval: Double.infinity)
request.addValue("application/vnd.pingidentity.device.activate+json", forHTTPHeaderField: "Content-Type")
request.addValue("Bearer {{accessToken}}", forHTTPHeaderField: "Authorization")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in
  guard let data = data else {
    print(String(describing: error))
    return
  }
  print(String(data: data, encoding: .utf8)!)
}

task.resume()
```

### Example Response

200 OK

```json
{
    "_links": {
        "self": {
            "href": "https://api.pingone.eu/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/users/d4543f69-e508-4cc6-bd16-b61baa4b3caf/devices/0783541c-a172-8d40-0783-541ca1728d40"
        },
        "environment": {
            "href": "https://api.pingone.eu/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6"
        },
        "user": {
            "href": "https://api.pingone.eu/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/users/d4543f69-e508-4cc6-bd16-b61baa4b3caf"
        }
    },
    "rp": {
        "id": "pingone.eu",
        "name": "pingone.eu"
    },
    "id": "0783541c-a172-8d40-0783-541ca1728d40",
    "environment": {
        "id": "abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6"
    },
    "user": {
        "id": "d4543f69-e508-4cc6-bd16-b61baa4b3caf"
    },
    "type": "PINGID_DESKTOP_GEN2",
    "nickname": "Desktop Mac 1",
    "lock": {
        "status": "UNLOCKED"
    },
    "block": {
        "status": "UNBLOCKED"
    },
    "status": "ACTIVE",
    "createdAt": "2026-02-17T13:34:34.840Z",
    "updatedAt": "2026-02-17T13:36:33.257Z",
    "os": {
        "version": "15.7.3",
        "type": "MAC"
    },
    "model": {},
    "application": {
        "id": "941d6390-ec3a-4bf4-858a-949c47ccd36e",
        "nativeName": "PingID Desktop",
        "version": "1.0.0",
        "pushSandbox": false
    },
    "unitId": "4d764d06-6aa5-4c15-ac8c-4df655cbf867"
}
```
