resources
Creates, updates, deletes, gets or lists a resources resource.
Overview
| Name | resources |
| Type | Resource |
| Id | vercel.marketplace.resources |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string | The ID provided by the 3rd party provider for the given resource |
name | string | The name of the resource as it is recorded in Vercel |
billing_plan_id | string | The ID of the billing plan the resource is subscribed to, if applicable (wire: billingPlanId) |
internal_id | string | The ID assigned by Vercel for the given resource (wire: internalId) |
product_id | string | The ID of the product the resource is derived from (wire: productId) |
metadata | object | The configured metadata for the resource as defined by its product's Metadata Schema |
notification | object | The notification, if set, displayed to the user when viewing the resource in Vercel |
protocol_settings | object | Any settings provided for the resource to support its product's protocols (wire: protocolSettings) |
status | string | The current status of the resource (error, onboarding, pending, ready, resumed, suspended, uninstalled) |
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the resource as it is recorded in Vercel |
billing_plan_id | string | The ID of the billing plan the resource is subscribed to, if applicable (wire: billingPlanId) |
internal_id | string | The ID assigned by Vercel for the given resource (wire: internalId) |
partner_id | string | The ID provided by the partner for the given resource (wire: partnerId) |
product_id | string | The ID of the product the resource is derived from (wire: productId) |
metadata | object | The configured metadata for the resource as defined by its product's Metadata Schema |
notification | object | The notification, if set, displayed to the user when viewing the resource in Vercel |
protocol_settings | object | Any settings provided for the resource to support its product's protocols (wire: protocolSettings) |
status | string | The current status of the resource (error, onboarding, pending, ready, resumed, suspended, uninstalled) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | integration_configuration_id, resource_id | Get a resource by its partner ID. | |
list | select | integration_configuration_id | Get all resources for a given installation ID. | |
update | update | integration_configuration_id, resource_id | This endpoint updates an existing resource in the installation. All parameters are optional, allowing partial updates. | |
import | replace | integration_configuration_id, resource_id, product_id, name, status | 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](https://vercel.com/docs/integrations/create-integration/marketplace-flows#import-existing-resources-flow) for the full contract. | |
delete | delete | integration_configuration_id, resource_id | Delete a resource owned by the selected installation ID. | |
update_secrets | exec | integration_configuration_id, integration_product_id_or_slug, resource_id, secrets | 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 /> | |
update_secrets_by_id | exec | integration_configuration_id, resource_id, secrets | 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 /> |
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.
| Name | Datatype | Description |
|---|---|---|
integration_configuration_id | string | |
integration_product_id_or_slug | string | |
resource_id | string |
SELECT examples
- get
- list
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
;
Get all resources for a given installation ID.
SELECT
name,
billing_plan_id,
internal_id,
partner_id,
product_id,
metadata,
notification,
protocol_settings,
status
FROM vercel.marketplace.resources
WHERE integration_configuration_id = '{{ integration_configuration_id }}' -- required
;
UPDATE examples
- update
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
- import
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
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.
- update_secrets
- update_secrets_by_id
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 }}
}'
;
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_by_id
@integration_configuration_id='{{ integration_configuration_id }}' --required,
@resource_id='{{ resource_id }}' --required
@@json=
'{
"secrets": "{{ secrets }}",
"partial": {{ partial }}
}'
;