Updates an ApiKey.
Authentication
Requires Authorization header with valid Bearer token for scope itwin-platform.
The ApiKey endpoints cannot be used with access tokens generated using the Try it out feature. Only tokens generated using a registered application are permitted.
For more documentation on authorization and how to get access token visit OAUTH2 Authorization page.
Rate limits
All iTwin Platform API operations have a rate limit. For more documentation on that visit Rate limits and quotas page.
Request parameters
Request headers
OAuth access token with itwin-platform scope
Setting to application/vnd.bentley.itwin-platform.v2+json is recommended.
Request body
ApiKey (update)
Name of the ApiKey.
Example
{ "displayName": "iModel Report ApiKey" }
Response 200 OK
Updated ApiKey successfully.
{ "key": { "id": "7abd419f-a01d-483c-9242-eaf98c348fbf", "displayName": "iModel Report ApiKey", "userEmail": "john.doe@example.com", "expiresAt": "2022-09-02T12:03:00.0000000+00:00", "_links": { "report": { "href": "https://api.bentley.com/insights/reporting/reports/3fa85f64-5717-4562-b3fc-2c963f66afa6" } } } }
Response 401 Unauthorized
This response indicates that request lacks valid authentication credentials. Access token might not been provided, issued by the wrong issuer, does not have required scopes or request headers were malformed.
{ "error": { "code": "HeaderNotFound", "message": "Header Authorization was not found in the request. Access denied." } }
Response 404 Not Found
Specified ApiKey was not found.
{ "error": { "code": "ApiKeyNotFound", "message": "Requested ApiKey is not available.", "target": "apiKeyId" } }
Response 422 Unprocessable Entity
The 422 (Unprocessable Entity) status code indicates that the request cannot be processed by the server due to a client error (e.g. malformed request syntax)
{ "error": { "code": "InvalidInsightsRequest", "message": "Cannot update ApiKey.", "details": [{ "code": "InvalidValue", "message": "Provided 'displayName' value is not valid. The value cannot be empty or consist only of whitespace characters.", "target": "displayName" }] } }
Response 429 Too many requests
This response indicates that the client sent more requests than allowed by this API for the current tier of the client.
{ "error": { "code": "RateLimitExceeded", "message": "The client sent more requests than allowed by this API for the current tier of the client." } }
Response headers
Number of seconds to wait until client is allowed to make more requests.
Link
Hyperlink container.
Hyperlink to the specific entity.
{ "type": "object", "title": "Link", "properties": { "href": { "type": "string", "description": "Hyperlink to the specific entity." } }, "description": "Hyperlink container.", "additionalProperties": false }
Error
Contains error information.
One of a server-defined set of error codes.
The target of the error.
A human-readable representation of the error.
{ "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "description": "One of a server-defined set of error codes." }, "target": { "type": "string", "nullable": true, "description": "The target of the error." }, "message": { "type": "string", "description": "A human-readable representation of the error." } }, "description": "Contains error information.", "additionalProperties": true }
ApiKey
Properties of the retrieved ApiKey.
The ApiKey Id.
ApiKey expiration DateTime.
Email of the user who created the ApiKey.
Name of the ApiKey.
{ "type": "object", "title": "ApiKey", "required": [ "id", "displayName", "userEmail", "expiresAt", "_links" ], "properties": { "id": { "type": "string", "description": "The ApiKey Id." }, "_links": { "$ref": "#/components/schemas/ApiKey_Links" }, "expiresAt": { "type": "string", "format": "date-time", "description": "ApiKey expiration DateTime." }, "userEmail": { "type": "string", "description": "Email of the user who created the ApiKey." }, "displayName": { "type": "string", "description": "Name of the ApiKey." } }, "description": "Properties of the retrieved ApiKey.", "additionalProperties": false }
ApiKey Links
Contains contextual hyperlinks to related data.
{ "type": "object", "title": "ApiKey Links", "required": [ "report" ], "properties": { "report": { "$ref": "#/components/schemas/Link" } }, "description": "Contains contextual hyperlinks to related data.", "additionalProperties": false }
ApiKey Response
Container for a ApiKey object.
{ "type": "object", "title": "ApiKey Response", "required": [ "key" ], "properties": { "key": { "$ref": "#/components/schemas/ApiKey" } }, "description": "Container for a ApiKey object.", "additionalProperties": false }
ApiKey (update)
Properties of the ApiKey to be updated.
Name of the ApiKey.
{ "type": "object", "title": "ApiKey (update)", "required": [ "displayName" ], "properties": { "displayName": { "type": "string", "description": "Name of the ApiKey." } }, "description": "Properties of the ApiKey to be updated.", "additionalProperties": false }
DetailedError
Contains error information and an array of more specific errors.
One of a server-defined set of error codes.
The target of the error.
A human-readable representation of the error.
{ "type": "object", "required": [ "code", "message", "details" ], "properties": { "code": { "type": "string", "description": "One of a server-defined set of error codes." }, "target": { "type": "string", "nullable": true, "description": "The target of the error." }, "details": { "type": "array", "items": { "$ref": "#/components/schemas/Error" }, "description": "Optional array of more specific errors." }, "message": { "type": "string", "description": "A human-readable representation of the error." } }, "description": "Contains error information and an array of more specific errors.", "additionalProperties": true }
Error Response
Gives details for an error that occurred while handling the request. Note that clients MUST NOT assume that every failed request will produce an object of this schema, or that all of the properties in the response will be non-null, as the error may have prevented this response from being constructed.
{ "type": "object", "title": "Error Response", "required": [ "error" ], "properties": { "error": { "$ref": "#/components/schemas/Error", "description": "Error information." } }, "description": "Gives details for an error that occurred while handling the request. Note that clients MUST NOT assume that every failed request will produce an object of this schema, or that all of the properties in the response will be non-null, as the error may have prevented this response from being constructed.", "additionalProperties": false }
Detailed Error Response
Gives details for an error that occurred while handling the request. Note that clients MUST NOT assume that every failed request will produce an object of this schema, or that all of the properties in the response will be non-null, as the error may have prevented this response from being constructed.
{ "type": "object", "title": "Detailed Error Response", "required": [ "error" ], "properties": { "error": { "$ref": "#/components/schemas/DetailedError", "description": "Error Detailed information." } }, "description": "Gives details for an error that occurred while handling the request. Note that clients MUST NOT assume that every failed request will produce an object of this schema, or that all of the properties in the response will be non-null, as the error may have prevented this response from being constructed.", "additionalProperties": false }
Was this page helpful?