Skip to main content

resources

Creates, updates, deletes, gets or lists a resources resource.

Overview

Nameresources
TypeResource
Idvercel.marketplace.resources

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe ID provided by the 3rd party provider for the given resource
namestringThe name of the resource as it is recorded in Vercel
billing_plan_idstringThe ID of the billing plan the resource is subscribed to, if applicable (wire: billingPlanId)
internal_idstringThe ID assigned by Vercel for the given resource (wire: internalId)
product_idstringThe ID of the product the resource is derived from (wire: productId)
metadataobjectThe configured metadata for the resource as defined by its product's Metadata Schema
notificationobjectThe notification, if set, displayed to the user when viewing the resource in Vercel
protocol_settingsobjectAny settings provided for the resource to support its product's protocols (wire: protocolSettings)
statusstringThe current status of the resource (error, onboarding, pending, ready, resumed, suspended, uninstalled)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectintegration_configuration_id, resource_idGet a resource by its partner ID.
listselectintegration_configuration_idGet all resources for a given installation ID.
updateupdateintegration_configuration_id, resource_idThis endpoint updates an existing resource in the installation. All parameters are optional, allowing partial updates.
importreplaceintegration_configuration_id, resource_id, product_id, name, statusThis endpoint imports (upserts) a resource to Vercel's installation. This may be needed if resources can be independently created on the partner's side and need to be synchronized to Vercel. When importing as part of the user-initiated import flow, call this endpoint before redirecting the user back to Vercel. See the [Import existing resources flow](https:​//vercel.com/docs/integrations/create-integration/marketplace-flows#import-existing-resources-flow) for the full contract.
deletedeleteintegration_configuration_id, resource_idDelete a resource owned by the selected installation ID.
update_secretsexecintegration_configuration_id, integration_product_id_or_slug, resource_id, secretsThis endpoint is deprecated and replaced with the endpoint [Update Resource Secrets](#update-resource-secrets). <br /> This endpoint updates the secrets of a resource. If a resource has projects connected, the connected secrets are updated with the new secrets. The old secrets may still be used by existing connected projects because they are not automatically redeployed. Redeployment is a manual action and must be completed by the user. All new project connections will use the new secrets.<br /> <br /> Use cases for this endpoint:<br /> <br /> - Resetting the credentials of a database in the partner. If the user requests the credentials to be updated in the partner’s application, the partner post the new set of secrets to Vercel, the user should redeploy their application and the expire the old credentials.<br />
update_secrets_by_idexecintegration_configuration_id, resource_id, secretsThis endpoint updates the secrets of a resource. If a resource has projects connected, the connected secrets are updated with the new secrets. The old secrets may still be used by existing connected projects because they are not automatically redeployed. Redeployment is a manual action and must be completed by the user. All new project connections will use the new secrets.<br /> <br /> Use cases for this endpoint:<br /> <br /> - Resetting the credentials of a database in the partner. If the user requests the credentials to be updated in the partner’s application, the partner post the new set of secrets to Vercel, the user should redeploy their application and the expire the old credentials.<br />

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
integration_configuration_idstring
integration_product_id_or_slugstring
resource_idstring

SELECT examples

Get a resource by its partner ID.

SELECT
id,
name,
billing_plan_id,
internal_id,
product_id,
metadata,
notification,
protocol_settings,
status
FROM vercel.marketplace.resources
WHERE integration_configuration_id = '{{ integration_configuration_id }}' -- required
AND resource_id = '{{ resource_id }}' -- required
;

UPDATE examples

This endpoint updates an existing resource in the installation. All parameters are optional, allowing partial updates.

UPDATE vercel.marketplace.resources
SET
ownership = '{{ ownership }}',
name = '{{ name }}',
status = '{{ status }}',
metadata = '{{ metadata }}',
billing_plan = '{{ billing_plan }}',
notification = '{{ notification }}',
extras = '{{ extras }}',
secrets = '{{ secrets }}'
WHERE
integration_configuration_id = '{{ integration_configuration_id }}' --required
AND resource_id = '{{ resource_id }}' --required
RETURNING
name;

REPLACE examples

This endpoint imports (upserts) a resource to Vercel's installation. This may be needed if resources can be independently created on the partner's side and need to be synchronized to Vercel. When importing as part of the user-initiated import flow, call this endpoint before redirecting the user back to Vercel. See the Import existing resources flow for the full contract.

REPLACE vercel.marketplace.resources
SET
ownership = '{{ ownership }}',
product_id = '{{ product_id }}',
name = '{{ name }}',
status = '{{ status }}',
metadata = '{{ metadata }}',
billing_plan = '{{ billing_plan }}',
notification = '{{ notification }}',
extras = '{{ extras }}',
secrets = '{{ secrets }}'
WHERE
integration_configuration_id = '{{ integration_configuration_id }}' --required
AND resource_id = '{{ resource_id }}' --required
AND product_id = '{{ product_id }}' --required
AND name = '{{ name }}' --required
AND status = '{{ status }}' --required
RETURNING
name;

DELETE examples

Delete a resource owned by the selected installation ID.

DELETE FROM vercel.marketplace.resources
WHERE integration_configuration_id = '{{ integration_configuration_id }}' --required
AND resource_id = '{{ resource_id }}' --required
;

Lifecycle Methods

EXEC variables use wire (API) names.

This endpoint is deprecated and replaced with the endpoint [Update Resource Secrets](#update-resource-secrets). <br /> This endpoint updates the secrets of a resource. If a resource has projects connected, the connected secrets are updated with the new secrets. The old secrets may still be used by existing connected projects because they are not automatically redeployed. Redeployment is a manual action and must be completed by the user. All new project connections will use the new secrets.<br /> <br /> Use cases for this endpoint:<br /> <br /> - Resetting the credentials of a database in the partner. If the user requests the credentials to be updated in the partner’s application, the partner post the new set of secrets to Vercel, the user should redeploy their application and the expire the old credentials.<br />

EXEC vercel.marketplace.resources.update_secrets
@integration_configuration_id='{{ integration_configuration_id }}' --required,
@integration_product_id_or_slug='{{ integration_product_id_or_slug }}' --required,
@resource_id='{{ resource_id }}' --required
@@json=
'{
"secrets": "{{ secrets }}",
"partial": {{ partial }}
}'
;