On this page

    1. Home
    2. API
    3. API Reference
    4. Device
    5. Remove Adopt Code

    Remove Adopt Code

    This endpoint allows the owner of a device to revoke an existing adoption code. Once removed, the code can no longer be used by any other network to take ownership of the device.


    POST /device/remove-adopt-code

    Revoke an active adopt code using the code and its associated secret.

    Request

    POST /device/remove-adopt-code

    Headers:

    {
      "Host": "api.bringyour.com",
      "Content-Type": "application/json",
      "Authorization": "Bearer YOUR_JWT_TOKEN"
    }

    Body:

    {
      "adopt_code": "string",
      "adopt_secret": "string"
    }

    Fields

    FieldTypeDescription
    adopt_codestringRequired. The alphanumeric adopt code to be removed.
    adopt_secretstringRequired. The secret associated with the adopt code (provided upon creation).

    Response

    200 Success

    Status: 200 OK Content-Type: application/json

    {
      "error": {
        "message": "string"
      }
    }

    Fields

    FieldTypeDescription
    errorobjectPresent if the request failed (null on success).
    error.messagestringDetails on why the code could not be removed.

    Example

    HTTP Request

    POST /device/remove-adopt-code HTTP/1.1
    Host: api.bringyour.com
    Content-Type: application/json
    Authorization: Bearer YOUR_JWT_TOKEN
     
    {
      "adopt_code": "ADOPT-1234-5678",
      "adopt_secret": "xyz789-secret"
    }

    Successful HTTP Response

    {
      "error": null
    }


    Powered by Sudoc v2.5.0
    Hide table of contents