Skip to main content
POST
/
core.v1.ResourceService
/
UpdateNativeUserIdentityLinkV2
cURL
curl -X POST "https://api.joinformal.com/core.v1.ResourceService/UpdateNativeUserIdentityLinkV2" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "example": "value"
  }'
fetch("https://api.joinformal.com/core.v1.ResourceService/UpdateNativeUserIdentityLinkV2", {
  method: "POST",
  headers: {
    "X-API-KEY": "YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    example: "value"
  })
})
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error(error));
import requests

url = "https://api.joinformal.com/core.v1.ResourceService/UpdateNativeUserIdentityLinkV2"
headers = {
    "X-API-KEY": "YOUR_API_KEY",
    "Content-Type": "application/json"
}
data = {
    "example": "value"
}

response = requests.post(url, headers=headers, json=data)
print(response.json())
package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "io"
    "net/http"
)

func main() {
    url := "https://api.joinformal.com/core.v1.ResourceService/UpdateNativeUserIdentityLinkV2"

    body := map[string]string{
        "example": "value",
    }

    jsonData, _ := json.Marshal(body)

    req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
    req.Header.Set("X-API-KEY", "YOUR_API_KEY")
    req.Header.Set("Content-Type", "application/json")

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    responseBody, _ := io.ReadAll(resp.Body)
    fmt.Println(string(responseBody))
}
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.joinformal.com/core.v1.ResourceService/UpdateNativeUserIdentityLinkV2",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'link' => [
        'id' => '<string>',
        'nativeUser' => [
                'id' => '<string>',
                'resourceId' => '<string>',
                'username' => '<string>',
                'secret' => '<string>',
                'useAsDefault' => true,
                'terminationProtection' => true,
                'createdAt' => '2023-11-07T05:31:56Z',
                'updatedAt' => '2023-11-07T05:31:56Z',
                'basic' => [
                                'username' => '<string>',
                                'usernameIsEnv' => true,
                                'password' => '<string>',
                                'passwordIsEnv' => true
                ],
                'httpApiKey' => [
                                'key' => '<string>',
                                'value' => '<string>'
                ],
                'httpBasic' => [
                                'header' => '<string>',
                                'username' => '<string>',
                                'password' => '<string>'
                ],
                'httpBearer' => [
                                'header' => '<string>',
                                'token' => '<string>'
                ],
                'iam' => [
                                'role' => '<string>',
                                'username' => '<string>'
                ],
                'kubernetes' => [
                                'kubeconfigEnv' => '<string>'
                ],
                'snowflakeKey' => [
                                'username' => '<string>',
                                'key' => '<string>'
                ],
                'sshKey' => [
                                'username' => '<string>',
                                'key' => '<string>'
                ]
        ],
        'terminationProtection' => true,
        'createdAt' => '2023-11-07T05:31:56Z',
        'updatedAt' => '2023-11-07T05:31:56Z',
        'group' => [
                'id' => '<string>',
                'name' => '<string>',
                'description' => '<string>',
                'dsyncGroupId' => '<string>',
                'terminationProtection' => true,
                'createdAt' => '2023-11-07T05:31:56Z',
                'updatedAt' => '2023-11-07T05:31:56Z'
        ],
        'resourceHostname' => [
                'id' => '<string>',
                'name' => '<string>',
                'hostname' => '<string>',
                'resource' => [
                                'id' => '<string>',
                                'name' => '<string>',
                                'hostname' => '<string>',
                                'port' => 123,
                                'environment' => '<string>',
                                'terminationProtection' => true,
                                'spaceId' => '<string>',
                                'space' => [
                                                                'id' => '<string>',
                                                                'name' => '<string>',
                                                                'description' => '<string>',
                                                                'terminationProtection' => true,
                                                                'createdAt' => '2023-11-07T05:31:56Z',
                                                                'updatedAt' => '2023-11-07T05:31:56Z'
                                ],
                                'createdAt' => '2023-11-07T05:31:56Z',
                                'updatedAt' => '2023-11-07T05:31:56Z',
                                'tags' => [
                                                                [
                                                                                                                                'key' => '<string>',
                                                                                                                                'value' => '<string>',
                                                                                                                                'id' => '<string>'
                                                                ]
                                ],
                                'aliases' => [
                                                                '<string>'
                                ]
                ],
                'terminationProtection' => true,
                'createdAt' => '2023-11-07T05:31:56Z',
                'updatedAt' => '2023-11-07T05:31:56Z'
        ],
        'user' => [
                'id' => '<string>',
                'dbUsername' => '<string>',
                'terminationProtection' => true,
                'expireAt' => '2023-11-07T05:31:56Z',
                'createdAt' => '2023-11-07T05:31:56Z',
                'updatedAt' => '2023-11-07T05:31:56Z',
                'groupIds' => [
                                '<string>'
                ],
                'fullName' => '<string>',
                'human' => [
                                'firstName' => '<string>',
                                'lastName' => '<string>',
                                'email' => 'jsmith@example.com'
                ],
                'machine' => [
                                'name' => '<string>'
                ]
        ]
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "X-API-KEY: <api-key>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
HttpResponse<String> response = Unirest.post("https://api.joinformal.com/core.v1.ResourceService/UpdateNativeUserIdentityLinkV2")
  .header("X-API-KEY", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"link\": {\n    \"id\": \"<string>\",\n    \"nativeUser\": {\n      \"id\": \"<string>\",\n      \"resourceId\": \"<string>\",\n      \"username\": \"<string>\",\n      \"secret\": \"<string>\",\n      \"useAsDefault\": true,\n      \"terminationProtection\": true,\n      \"createdAt\": \"2023-11-07T05:31:56Z\",\n      \"updatedAt\": \"2023-11-07T05:31:56Z\",\n      \"basic\": {\n        \"username\": \"<string>\",\n        \"usernameIsEnv\": true,\n        \"password\": \"<string>\",\n        \"passwordIsEnv\": true\n      },\n      \"httpApiKey\": {\n        \"key\": \"<string>\",\n        \"value\": \"<string>\"\n      },\n      \"httpBasic\": {\n        \"header\": \"<string>\",\n        \"username\": \"<string>\",\n        \"password\": \"<string>\"\n      },\n      \"httpBearer\": {\n        \"header\": \"<string>\",\n        \"token\": \"<string>\"\n      },\n      \"iam\": {\n        \"role\": \"<string>\",\n        \"username\": \"<string>\"\n      },\n      \"kubernetes\": {\n        \"kubeconfigEnv\": \"<string>\"\n      },\n      \"snowflakeKey\": {\n        \"username\": \"<string>\",\n        \"key\": \"<string>\"\n      },\n      \"sshKey\": {\n        \"username\": \"<string>\",\n        \"key\": \"<string>\"\n      }\n    },\n    \"terminationProtection\": true,\n    \"createdAt\": \"2023-11-07T05:31:56Z\",\n    \"updatedAt\": \"2023-11-07T05:31:56Z\",\n    \"group\": {\n      \"id\": \"<string>\",\n      \"name\": \"<string>\",\n      \"description\": \"<string>\",\n      \"dsyncGroupId\": \"<string>\",\n      \"terminationProtection\": true,\n      \"createdAt\": \"2023-11-07T05:31:56Z\",\n      \"updatedAt\": \"2023-11-07T05:31:56Z\"\n    },\n    \"resourceHostname\": {\n      \"id\": \"<string>\",\n      \"name\": \"<string>\",\n      \"hostname\": \"<string>\",\n      \"resource\": {\n        \"id\": \"<string>\",\n        \"name\": \"<string>\",\n        \"hostname\": \"<string>\",\n        \"port\": 123,\n        \"environment\": \"<string>\",\n        \"terminationProtection\": true,\n        \"spaceId\": \"<string>\",\n        \"space\": {\n          \"id\": \"<string>\",\n          \"name\": \"<string>\",\n          \"description\": \"<string>\",\n          \"terminationProtection\": true,\n          \"createdAt\": \"2023-11-07T05:31:56Z\",\n          \"updatedAt\": \"2023-11-07T05:31:56Z\"\n        },\n        \"createdAt\": \"2023-11-07T05:31:56Z\",\n        \"updatedAt\": \"2023-11-07T05:31:56Z\",\n        \"tags\": [\n          {\n            \"key\": \"<string>\",\n            \"value\": \"<string>\",\n            \"id\": \"<string>\"\n          }\n        ],\n        \"aliases\": [\n          \"<string>\"\n        ]\n      },\n      \"terminationProtection\": true,\n      \"createdAt\": \"2023-11-07T05:31:56Z\",\n      \"updatedAt\": \"2023-11-07T05:31:56Z\"\n    },\n    \"user\": {\n      \"id\": \"<string>\",\n      \"dbUsername\": \"<string>\",\n      \"terminationProtection\": true,\n      \"expireAt\": \"2023-11-07T05:31:56Z\",\n      \"createdAt\": \"2023-11-07T05:31:56Z\",\n      \"updatedAt\": \"2023-11-07T05:31:56Z\",\n      \"groupIds\": [\n        \"<string>\"\n      ],\n      \"fullName\": \"<string>\",\n      \"human\": {\n        \"firstName\": \"<string>\",\n        \"lastName\": \"<string>\",\n        \"email\": \"jsmith@example.com\"\n      },\n      \"machine\": {\n        \"name\": \"<string>\"\n      }\n    }\n  }\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.joinformal.com/core.v1.ResourceService/UpdateNativeUserIdentityLinkV2")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"link\": {\n    \"id\": \"<string>\",\n    \"nativeUser\": {\n      \"id\": \"<string>\",\n      \"resourceId\": \"<string>\",\n      \"username\": \"<string>\",\n      \"secret\": \"<string>\",\n      \"useAsDefault\": true,\n      \"terminationProtection\": true,\n      \"createdAt\": \"2023-11-07T05:31:56Z\",\n      \"updatedAt\": \"2023-11-07T05:31:56Z\",\n      \"basic\": {\n        \"username\": \"<string>\",\n        \"usernameIsEnv\": true,\n        \"password\": \"<string>\",\n        \"passwordIsEnv\": true\n      },\n      \"httpApiKey\": {\n        \"key\": \"<string>\",\n        \"value\": \"<string>\"\n      },\n      \"httpBasic\": {\n        \"header\": \"<string>\",\n        \"username\": \"<string>\",\n        \"password\": \"<string>\"\n      },\n      \"httpBearer\": {\n        \"header\": \"<string>\",\n        \"token\": \"<string>\"\n      },\n      \"iam\": {\n        \"role\": \"<string>\",\n        \"username\": \"<string>\"\n      },\n      \"kubernetes\": {\n        \"kubeconfigEnv\": \"<string>\"\n      },\n      \"snowflakeKey\": {\n        \"username\": \"<string>\",\n        \"key\": \"<string>\"\n      },\n      \"sshKey\": {\n        \"username\": \"<string>\",\n        \"key\": \"<string>\"\n      }\n    },\n    \"terminationProtection\": true,\n    \"createdAt\": \"2023-11-07T05:31:56Z\",\n    \"updatedAt\": \"2023-11-07T05:31:56Z\",\n    \"group\": {\n      \"id\": \"<string>\",\n      \"name\": \"<string>\",\n      \"description\": \"<string>\",\n      \"dsyncGroupId\": \"<string>\",\n      \"terminationProtection\": true,\n      \"createdAt\": \"2023-11-07T05:31:56Z\",\n      \"updatedAt\": \"2023-11-07T05:31:56Z\"\n    },\n    \"resourceHostname\": {\n      \"id\": \"<string>\",\n      \"name\": \"<string>\",\n      \"hostname\": \"<string>\",\n      \"resource\": {\n        \"id\": \"<string>\",\n        \"name\": \"<string>\",\n        \"hostname\": \"<string>\",\n        \"port\": 123,\n        \"environment\": \"<string>\",\n        \"terminationProtection\": true,\n        \"spaceId\": \"<string>\",\n        \"space\": {\n          \"id\": \"<string>\",\n          \"name\": \"<string>\",\n          \"description\": \"<string>\",\n          \"terminationProtection\": true,\n          \"createdAt\": \"2023-11-07T05:31:56Z\",\n          \"updatedAt\": \"2023-11-07T05:31:56Z\"\n        },\n        \"createdAt\": \"2023-11-07T05:31:56Z\",\n        \"updatedAt\": \"2023-11-07T05:31:56Z\",\n        \"tags\": [\n          {\n            \"key\": \"<string>\",\n            \"value\": \"<string>\",\n            \"id\": \"<string>\"\n          }\n        ],\n        \"aliases\": [\n          \"<string>\"\n        ]\n      },\n      \"terminationProtection\": true,\n      \"createdAt\": \"2023-11-07T05:31:56Z\",\n      \"updatedAt\": \"2023-11-07T05:31:56Z\"\n    },\n    \"user\": {\n      \"id\": \"<string>\",\n      \"dbUsername\": \"<string>\",\n      \"terminationProtection\": true,\n      \"expireAt\": \"2023-11-07T05:31:56Z\",\n      \"createdAt\": \"2023-11-07T05:31:56Z\",\n      \"updatedAt\": \"2023-11-07T05:31:56Z\",\n      \"groupIds\": [\n        \"<string>\"\n      ],\n      \"fullName\": \"<string>\",\n      \"human\": {\n        \"firstName\": \"<string>\",\n        \"lastName\": \"<string>\",\n        \"email\": \"jsmith@example.com\"\n      },\n      \"machine\": {\n        \"name\": \"<string>\"\n      }\n    }\n  }\n}"

response = http.request(request)
puts response.read_body
{
  "link": {
    "id": "<string>",
    "nativeUser": {
      "id": "<string>",
      "resourceId": "<string>",
      "username": "<string>",
      "secret": "<string>",
      "useAsDefault": true,
      "terminationProtection": true,
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z",
      "basic": {
        "username": "<string>",
        "usernameIsEnv": true,
        "password": "<string>",
        "passwordIsEnv": true
      },
      "httpApiKey": {
        "key": "<string>",
        "value": "<string>"
      },
      "httpBasic": {
        "header": "<string>",
        "username": "<string>",
        "password": "<string>"
      },
      "httpBearer": {
        "header": "<string>",
        "token": "<string>"
      },
      "iam": {
        "role": "<string>",
        "username": "<string>"
      },
      "kubernetes": {
        "kubeconfigEnv": "<string>"
      },
      "snowflakeKey": {
        "username": "<string>",
        "key": "<string>"
      },
      "sshKey": {
        "username": "<string>",
        "key": "<string>"
      }
    },
    "terminationProtection": true,
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z",
    "group": {
      "id": "<string>",
      "name": "<string>",
      "description": "<string>",
      "dsyncGroupId": "<string>",
      "terminationProtection": true,
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z"
    },
    "resourceHostname": {
      "id": "<string>",
      "name": "<string>",
      "hostname": "<string>",
      "resource": {
        "id": "<string>",
        "name": "<string>",
        "hostname": "<string>",
        "port": 123,
        "environment": "<string>",
        "terminationProtection": true,
        "spaceId": "<string>",
        "space": {
          "id": "<string>",
          "name": "<string>",
          "description": "<string>",
          "terminationProtection": true,
          "createdAt": "2023-11-07T05:31:56Z",
          "updatedAt": "2023-11-07T05:31:56Z"
        },
        "createdAt": "2023-11-07T05:31:56Z",
        "updatedAt": "2023-11-07T05:31:56Z",
        "tags": [
          {
            "key": "<string>",
            "value": "<string>",
            "id": "<string>"
          }
        ],
        "aliases": [
          "<string>"
        ]
      },
      "terminationProtection": true,
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z"
    },
    "user": {
      "id": "<string>",
      "dbUsername": "<string>",
      "terminationProtection": true,
      "expireAt": "2023-11-07T05:31:56Z",
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z",
      "groupIds": [
        "<string>"
      ],
      "fullName": "<string>",
      "human": {
        "firstName": "<string>",
        "lastName": "<string>",
        "email": "jsmith@example.com"
      },
      "machine": {
        "name": "<string>"
      }
    }
  }
}
{
  "code": "invalid_request",
  "message": "Invalid request parameters",
  "details": {}
}
{
  "code": "unauthorized",
  "message": "Authentication required"
}
{
  "code": "forbidden",
  "message": "Insufficient permissions to perform this action"
}
{
  "code": "not_found",
  "message": "Resource not found"
}
{
  "code": "internal_error",
  "message": "An internal error occurred"
}

Authorizations

X-API-KEY
string
header
required

API key authentication. Get your API key from the Formal console.

Body

application/json

Exactly one of these fields is required: group or resource_hostname or user.

Response

Success

Exactly one of these fields is required: group or resource_hostname or user.