Skip to main content

update_licensee

Update

Updates a licensee's address, postcode, allowed URLs and daily limit. Returns the updated licensee. The name is fixed at creation.

Endpoint​

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

See the API reference for this endpoint.

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 update_licensee 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.

Request Body​

NameTypeRequiredDescription
namestrnoLicensee individual or organisation name
addressstrnoLicensee's first, second and third line address as well as post town concatenated by commas
postcodestrnoLicensee's postcode
whitelistlist[str]noA list of allowed URLs. An empty list disables the check. A request is allowed when its Origin or Referer header matches an entry. Use one of these formats: - https://www.example.com allows one site. Scheme and host must match - *.example.com allows the domain and all its subdomains
dailyrequests.UpdateLicenseeDailyno

Nested settings are typed dictionaries from ideal_postcodes.requests.

class UpdateLicenseeDaily(TypedDict):
limit: NotRequired[float | None]

Response Type​

from ideal_postcodes.types import UpdateLicenseeResult

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​

update_licensee.pypython
from ideal_postcodes import IdealPostcodes

with IdealPostcodes("ak_test") as client:
licensee = client.update_licensee("ak_test", "sl_example", user_token="uk_example", name="Updated Company")