delete_access_token¶
- AccessTokensApi.delete_access_token(id, role_id=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Delete an access token
Deletes an access token by TokenId. Only the token owner can delete it (else AUTH-1010). Missing token returns IPV-1002. Success Message is “Successfully deleted token”. Not idempotent after delete (subsequent calls return IPV-1002).
- Parameters:
id (str) – TokenId of the access token to delete. (required)
role_id (str) – Amorphic role ID header.
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
- Returns:
Returns the result object.
Request and Response Examples¶
HTTP: DELETE /access-tokens/{id}
Success (HTTP 200)¶
Access token deleted successfully
Deleted
{
"Message": "Successfully deleted token"
}
Errors¶
Documented error codes: IPV-1002, AUTH-1010, DB-1003, RTE-1001, EMF-1001.
HTTP 400
Validation or authorization failure. Body is {“Message”: “<CODE> - <text>”}. Common codes: IPV-1002 (TokenId not found), AUTH-1010 (not owner), DB-1003 (DynamoDB delete failed).
TokenId not found
{
"Message": "IPV-1002 - Invalid TokenId - a2f7d3b1-8e5c-4a6f-9d1e-2b3c4d5e6f7a, resource not found."
}
Caller does not own token
{
"Message": "AUTH-1010 - User user1 is not authorized to perform this operation"
}
HTTP 500
Backend failure. Body is {“Message”: “<CODE> - <text>”} (typically RTE-1001 via EMF-1001).
Unexpected failure
{
"Message": "RTE-1001 - <exception text>"
}