View all methods

users.links.delete

Unlink one account from a user, keeping the user’s other linked accounts for that source.

Facts

Method POST https://api.getdx.com/users.links.delete
Required scope users:write

Arguments

Required arguments

Name Type Description
token Token Auth token passed as an HTTP header.
user_id Text The DX user ID, as returned in id by users.list.
source Text The tool the account comes from. See Sources.
account_id Text The account ID to unlink.

Usage info

This method requires DX Data Cloud.

DX reads the user’s current accounts for the source, removes this account, and saves the result the same way as users.links.set. GitHub and GitLab usernames on the user’s profile are not changed.

If the account is not linked to the user, the request succeeds without making a change.

A change made outside the API while the request is running can be overwritten. To confirm the result, call users.links.list.

Example request

This is a typical request:

curl -X POST https://api.getdx.com/users.links.delete \
  -H 'Authorization: Bearer xxxx-xxxxxxxxx-xxxx' \
  -H 'Content-Type: application/json' \
  -d '{
    "user_id": "NTEyMDUw",
    "source": "github",
    "account_id": "4812"
  }'

Example response

This is a typical success response:

{
  "ok": true
}

Errors

This table lists the expected errors that this method could return. However, other errors can be returned in the case where the service is down or other unexpected factors affect processing. Callers should always check the value of the ok param in the response.

Error Description
not_authed No authentication token provided, or Data Cloud is not enabled for the account.
not_authorized The bearer token does not include users:write.
not_found The user was not found.
user_not_in_datacloud The user has not synced to Data Cloud yet.
link_update_in_progress Another request for the same user and source did not finish in time. Retry the request.
query_timeout Data Cloud did not respond in time. Retry the request.
datacloud_unavailable Data Cloud did not accept the change. Retry the request.
Invalid parameter: ... source is not supported, or account_id is not a positive integer.
Missing required parameter: user_id user_id was not provided.