Registry Providers API
You can add publicly curated providers from the Terraform Registry and custom, private providers to your HCP Terraform private registry. The private registry stores a pointer to public providers so that you can view their data from within HCP Terraform. This lets you clearly designate all of the providers that are recommended for the organization and makes them centrally accessible.
All members of an organization can view and use both public and private providers, but you need owners team or Manage Private Registry permissions to add, update, or delete them them in private registry.
HCP Terraform Registry Implementation
For publicly curated providers, the HCP Terraform Registry acts as a proxy to the Terraform Registry for the following:
- The public registry discovery endpoints have the path prefix provided in the discovery document which is currently
/api/registry/public/v1
. - Authentication is handled the same as all other HCP Terraform endpoints.
List Terraform Registry Providers for an Organization
GET /organizations/:organization_name/registry-providers
Parameters
Parameter | Description |
---|---|
:organization_name | The name of the organization to list available providers from. |
Lists the providers included in the private registry for the specified organization.
Status | Response | Reason |
---|---|---|
200 | JSON API document (type: "registry-providers" ) | Success |
404 | JSON API error object | Providers not found or user unauthorized to perform action |
Query Parameters
This endpoint supports pagination with standard URL query parameters. Remember to percent-encode [
as %5B
and ]
as %5D
if your tooling doesn't automatically encode URLs.
Parameter | Description |
---|---|
q | Optional. A search query string. Providers are searchable by both their name and their namespace fields. |
filter[field name] | Optional. If specified, restricts results to those with the matching field name value. Valid values are registry_name , and organization_name . |
page[number] | Optional. If omitted, the endpoint will return the first page. |
page[size] | Optional. If omitted, the endpoint will return 20 registry providers per page. |
Sample Request
Sample Response
Create a Provider
POST /organizations/:organization_name/registry-providers
Use this endpoint to create both public and private providers:
- Public providers: The public provider record will be available in the organization's registry provider list immediately after creation. You cannot create versions for public providers; you must use the versions available on the Terraform Registry.
- Private providers: The private provider record will be available in the organization's registry provider list immediately after creation, but you must create a version and upload release assets before consumers can use it. The private registry does not automatically update private providers when you release new versions. You must add each new version with the Create a Provider Version endpoint.
Parameters
Parameter | Description |
---|---|
:organization_name | The name of the organization to create a provider in. The organization must already exist, and the token authenticating the API request must belong to the "owners" team or a member of the "owners" team. |
Status | Response | Reason |
---|---|---|
201 | JSON API document (type: "registry-providers" ) | Successfully published provider |
422 | JSON API error object | Malformed request body (missing attributes, wrong types, etc.) |
403 | JSON API error object | Forbidden - public provider curation disabled |
404 | JSON API error object | User not authorized |
Request Body
Important: For private providers, you must also create a version, a platform, and upload release assets before consumers can use the provider. Refer to Publishing a Private Provider for more details.
This POST endpoint requires a JSON object with the following properties as a request payload.
Properties without a default value are required.
Key path | Type | Default | Description |
---|---|---|---|
data.type | string | Must be "registry-providers" . | |
data.attributes.name | string | The name of the provider. | |
data.attributes.namespace | string | The namespace of the provider. For private providers this is the same as the :organization_name parameter. | |
data.attributes.registry-name | string | Whether this is a publicly maintained provider or private. Must be either public or private . |
Sample Payload (Private Provider)
Sample Payload (Public Provider)
Sample Request
Sample Response (Private Provider)
Sample Response (Public Provider)
Get a Provider
GET /organizations/:organization_name/registry-providers/:registry_name/:namespace/:name
Parameters
Parameter | Description |
---|---|
:organization_name | The name of the organization the provider belongs to. |
:registry_name | Whether this is a publicly maintained provider or private. Must be either public or private . |
:namespace | The namespace of the provider. For private providers this is the same as the :organization_name parameter. |
:name | The provider name. |
Status | Response | Reason |
---|---|---|
200 | JSON API document (type: "registry-providers" ) | Success |
403 | JSON API error object | Forbidden - public provider curation disabled |
404 | JSON API error object | Provider not found or user unauthorized to perform action |
Sample Request (Private Provider)
Sample Request (Public Provider)
Sample Response (Private Provider)
Sample Response (Public Provider)
Delete a Provider
DELETE /organizations/:organization_name/registry-providers/:registry_name/:namespace/:name
Parameters
Parameter | Description |
---|---|
:organization_name | The name of the organization to delete a provider from. The organization must already exist, and the token authenticating the API request must belong to the "owners" team or a member of the "owners" team. |
:registry_name | Whether this is a publicly maintained provider or private. Must be either public or private . |
:namespace | The namespace of the provider that will be deleted. |
:name | The name of the provider that will be deleted. |
Status | Response | Reason |
---|---|---|
204 | No Content | Success |
403 | JSON API error object | Forbidden - public provider curation disabled |
404 | JSON API error object | Provider not found or user not authorized to perform action |
Sample Request (Private Provider)
Sample Request (Public Provider)