AnyCAGateway REST API

The AnyCAGateway REST APIClosed An API is a set of functions to allow creation of applications. Keyfactor offers the Keyfactor API, which allows third-party software to integrate with the advanced certificate enrollment and management features of Keyfactor Command. provides programmatic access to gateway-managed records and operations used to broker certificate lifecycle activities between Keyfactor Command and connected third-party certificate authorities. Rather than modifying configuration directly in Keyfactor Command or the external CAClosed A certificate authority (CA) is an entity that issues digital certificates. Within Keyfactor Command, a CA may be a Microsoft CA or a Keyfactor gateway to a cloud-based or remote CA. provider, API operations act on records maintained within the gateway itself, which control how the gateway performs enrollmentClosed Certificate enrollment refers to the process by which a user requests a digital certificate. The user must submit the request to a certificate authority (CA)., revocation, validation, and synchronization on behalf of Command.

Through the AnyCAGateway REST API, authorized clients can manage gateway configuration and perform certificate lifecycle actions, including:

  • Managing gateway-managed CA records that represent external cloud CAs.

  • Searching for, enrolling for, and revoking certificates through the gateway.

  • Configuring certificate profiles, end entity profiles, and claims used during enrollment.

  • Managing domain validation records and identity providers used by the gateway.

  • Performing additional gateway-specific configuration and supporting operations.

Documentation for the AnyCAGateway REST API is provided in two complementary resources:

For security purposes, sensitive values such as client secrets are never returned in full and may be omitted or masked in API responses. Configuration changes made through the API are applied asynchronously and typically become effective within approximately 60 seconds.

Tip:  Click the help icon () at the top of the AnyCAGateway REST next to the Logout button to find the embedded web copy of the AnyGateway REST API Reference and Utility.

You can also browse to the AnyGateway REST API Reference and Utility directly using the following link (where gateway.keyexample.com is the fully qualified domain name of your AnyCAGateway REST server or the DNSClosed The Domain Name System is a service that translates names into IP addresses. alias you are using to reference your AnyCAGateway REST server, if applicable, and AnyGatewayREST is the virtual directory you created for the gateway):

https://gateway.keyexample.com/AnyGatewayREST/swagger

Endpoint Common Features

All API endpoints are accessed under a base path that corresponds to an application hosted on the web server. This path is configurable during installation. The default base path is /AnyGatewayREST.

Each endpointClosed An endpoint is a URL that enables the API to gain access to resources on a server. consists of the base path followed by the API component name. Individual operations are performed by sending an HTTP method (for example, GET, POST, or PUT) to the endpoint.

For example, the endpoint for identity provider operations is:

/AnyGatewayREST/IdentityProviders

Different HTTP methods sent to this endpoint perform different operations.

The API uses the following common request headers:

  • Content-Type: application/json
  • Authorization: Bearer <your OAuth token>

HTTP Statuses

The following HTTP Statuses may be returned by AnyCAGateway REST API requests:

  • 200 OK: Request successful; results, if applicable, in response body.

  • 204 No Content: Request successful; results in no response.

  • 400 Bad Request: Malformed or invalid data; additional information may be available in the response body and/or AnyCAGateway REST server logs.

  • 401 Unauthorized: Invalid credentials (user unauthenticated).

  • 403 Forbidden: Can often indicate that the user does not have the appropriate permissions for this action in AnyCAGateway REST (user unauthorized).

  • 404 Page not Found: Invalid request path.

  • 405 Method Not Allowed: Invalid request; check the requested method (POST vs GET), the authentication credentials, and the endpoint path.

  • 500 Internal Server Error: AnyCAGateway REST encountered an unexpected error attempting to handle the request. See response body and AnyCAGateway REST server logs for details.

  • 502 Bad Gateway: AnyCAGateway REST attempted to contact Keyfactor Command or other upstream server to process the request, but was unable to. See AnyCAGateway REST server logs for details.