Skip to main content

regenerate_licensee_key

Regenerate Key

Regenerates a licensee's key and returns the licensee with the new key. The previous key stops working immediately, so update any integration that uses it.

Endpoint​

POST /keys/{key}/licensees/{licensee}/regenerate-key

This operation needs a Management Key. Pass it as the required user_token keyword argument; the client sends it in the Authorization header. See setup.

Import​

from ideal_postcodes import IdealPostcodes

Call regenerate_licensee_key on the IdealPostcodes client. Path parameters are positional; query and body parameters are keyword-only.

Path Parameters​

NameTypeRequiredDescription
keystryesAPI Key The API Key to retrieve. Begins ak_.
licenseestryesLicensee Key Uniquely identifies a licensee.

Query Parameters​

None.

Response Type​

from ideal_postcodes.types import RegenerateLicenseeKeyResult

Errors​

Unsuccessful HTTP responses raise APIError or a subclass, with the HTTP status and the API error code and message. Connection failures and timeouts raise TransportError. Unexpected responses raise ProtocolError. All derive from ClientError. See error handling.

Example​

regenerate_licensee_key.pypython
from ideal_postcodes import IdealPostcodes

with IdealPostcodes("ak_test") as client:
licensee = client.regenerate_licensee_key("ak_test", "sl_example", user_token="uk_example")