MetriBeacon
Menu

POST Start a ten-minute device link

/api/v1/agent/device-links

Generate secrets locally and submit only hashes. Repeating an identical request with the same client token returns the same challenge. No account is created.

On this page

Access and permissions

Generate secrets locally and submit only hashes. Repeating an identical request with the same client token returns the same challenge. No account is created.

deviceLinkClient

Parameters and headers

No path, query or additional request-header parameters.

Request body

FieldType and limitsRequiredMeaning
$DeviceLinkRequestYes—
$.architecturestring; {"enum":["amd64","arm64"]}Yes—
$.key_hashstring; {"pattern":"^[0-9a-f]{64}$"}Yes—
$.key_prefixstring; {"pattern":"^[0-9a-f]{12}$"}Yes—
$.management_hashstring; {"pattern":"^[0-9a-f]{64}$"}Yes—
$.management_prefixstring; {"pattern":"^[0-9a-f]{12}$"}Yes—
$.namestring; {"maxLength":128,"minLength":1}Yes—
$.platformstring; {"enum":["linux","darwin","windows"]}Yes—
$.system_drivestringYes—
$.user_codestring; {"pattern":"^[0-9]{8}$"}Yes—

Responses

application/json

FieldType and limitsRequiredMeaning
$DeviceLinkChallengeYes—
$.expires_atstring; {"format":"date-time"}Yes—
$.idstring; {"format":"uuid"}Yes—
$.intervalinteger; {"const":3}Yes—
$.user_codestring; {"pattern":"^[0-9]{8}$"}Yes—
$.verification_uristring; {"format":"uri"}Yes—
$.verification_uri_completestring; {"format":"uri"}Yes—
Stable error codes
link_conflict
Stable error codes
invalid_link

application/problem+json

FieldType and limitsRequiredMeaning
$ProblemYes—
$.codestringYesStable machine-readable error code
$.detailstringYesShort localized explanation without internal error details
$.instancestringYesUnique relative identifier /api/v1/requests/{request_id}; not a retrievable resource
$.messagestringYesTemporarily identical to detail for existing clients
$.message_keystringYesStable translation key for changing the displayed language without another request
$.message_paramsobject; {"additionalProperties":true}YesNamed, safely rendered message parameters; never arbitrary HTML
$.request_idstring; {"pattern":"^[0-9a-f]{32}$"}YesServer-generated diagnostic identifier. It contains no login token or credential.
$.statusinteger; {"maximum":599,"minimum":400}Yes—
$.titlestringYesLocalized HTTP status title
$.typestring; {"const":"about:blank"}Yes—

Retries and asynchronous work

This change does not have a general retry guarantee. If the response is unclear, read the affected resource before trying again. Follow Retry-After waiting times and request new sign-in or action codes when they expire.

Request examples

Replace demo IDs, timestamps and placeholders with your own values. For a retry, keep the same IDs, time and content. These examples do not run requests on this page.

Keep login links, codes, cookies and keys private. Do not print them in logs or share them in support requests.

shell
curl --fail-with-body --request POST https://metribeacon.com/api/v1/agent/device-links --header 'Accept: application/json' --header 'Authorization: Bearer mbl_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' --header 'Content-Type: application/json' --data '{"name":"Demo device","platform":"windows","architecture":"arm64","system_drive":"C:/","user_code":"12345678","key_prefix":"aaaaaaaaaaaa","key_hash":"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb","management_prefix":"cccccccccccc","management_hash":"dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd"}'
python
import urllib.request
headers = {'Accept': 'application/json', 'Authorization': 'Bearer mbl_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'Content-Type': 'application/json'}
request = urllib.request.Request('https://metribeacon.com/api/v1/agent/device-links', headers=headers, method='POST', data='{"name":"Demo device","platform":"windows","architecture":"arm64","system_drive":"C:/","user_code":"12345678","key_prefix":"aaaaaaaaaaaa","key_hash":"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb","management_prefix":"cccccccccccc","management_hash":"dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd"}'.encode())
with urllib.request.urlopen(request) as response:
    print(response.read().decode())
javascript
const response = await fetch("https://metribeacon.com/api/v1/agent/device-links", {"method": "POST", "headers": {"Accept": "application/json", "Authorization": "Bearer mbl_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "Content-Type": "application/json"}, "body": "{\"name\":\"Demo device\",\"platform\":\"windows\",\"architecture\":\"arm64\",\"system_drive\":\"C:/\",\"user_code\":\"12345678\",\"key_prefix\":\"aaaaaaaaaaaa\",\"key_hash\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"management_prefix\":\"cccccccccccc\",\"management_hash\":\"dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"}"});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());
go
package main
import ("fmt"; "io"; "net/http"; "strings")
func main() {
 req, err := http.NewRequest("POST", "https://metribeacon.com/api/v1/agent/device-links", strings.NewReader("{\"name\":\"Demo device\",\"platform\":\"windows\",\"architecture\":\"arm64\",\"system_drive\":\"C:/\",\"user_code\":\"12345678\",\"key_prefix\":\"aaaaaaaaaaaa\",\"key_hash\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"management_prefix\":\"cccccccccccc\",\"management_hash\":\"dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"}")); if err != nil { panic(err) }
 req.Header.Set("Accept", "application/json")
 req.Header.Set("Authorization", "Bearer mbl_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
 req.Header.Set("Content-Type", "application/json")
 response, err := http.DefaultClient.Do(req); if err != nil { panic(err) }; defer response.Body.Close(); data, err := io.ReadAll(response.Body); if err != nil { panic(err) }; fmt.Printf("HTTP %d\n%s\n", response.StatusCode, data)
}