top of page

Rotate an org key

PUT /<org_name>

Each org authorizes access by an org key. A client uses the org key to interact with the org, like taking/releasing/reading roles and reading/writing/deleting data.  A client cannot create a new org, but can rotate the org key.


A client uses a PUT request to rotate an org key. They can provide a new org key, or let the service generate a new key. A generated org key will be 30 random alpha-numeric (a-z, A-Z, and 0-9) characters.


Note: The service does not put any constraint on the org keys provided by the clients. When providing your own org key, make sure it is secure enough for your purpose.

Request

Example

Let the service generate a new org_key:

PUT /<org_name>
Host: <service_address>
Authorization: <current org_key>

Provide your own org_key:

PUT /<org_name>
Host: <service_address>
Authorization: <current org_key>
Content-Type: application/json
{
	“org_key”: <string>,
}


PUT /sample_org
Host: beta.useast2.registry.dkplatform.io
Authorization: randomAlphaNumericString


PUT /sample_org
Host: beta.useast2.registry.dkplatform.io
Authorization: randomAlphaNumericString
Content-Type: application/json
{
	“org_key”: "This can be anything!!",
}

Param
Meaning
Authorization
The credential showing the client's permission for the request. It is the `org_key` of the org.
Host
The service address, such as "useast2.registry.dkplatform.io".
x-dk-org-time
A response header that shows the org_time after the request is executed.
"org_key"
A response field that shows the client the new org_key.
"remaining_milliseconds"
The org has been flagged for deletion and will be deleted after these many milliseconds.

Response

200 OK

x-dk-org-time: <u64>

{

“org_key”: <string>,

}


Success. The new org_key is returned.

400 BAD REQUEST

Wrong format in org name, missing Authorization header, or Authorization header is empty.

403 FORBIDDEN


Wrong org_key in the Authorization header, or the org does not exist.

409 CONFLICT

x-dk-org-time: <org_time>

{

“remaining_milliseconds”: <u64>,

}

The org is flagged for deletion.

500 INTERNAL SERVER ERROR

An unexpected error happened at the server. It is unsure if the request has been processed or not.


© 2024 by DK Lab.

bottom of page