Skip to content
Helicarrier Developers

Add reference

Inject a value from a provider service into a consumer’s environment variable.

POST /api/services/{id}/references HTTPS
Request & response examples
Request example Server-side
curl --fail-with-body --request POST \
'https://app.helicarrier.xyz/api/services/YOUR_ID/references' \
-H "Authorization: Bearer $HELI_API_KEY" \
-H 'Content-Type: application/json' \
--data '{
"providerId": "YOUR_DATABASE_SERVICE_ID",
"sourceKind": "url",
"varKey": "DATABASE_URL"
}'
Response example 201
{
"reference": {
"id": "ref_example",
"consumerId": "svc_example",
"providerId": "svc_database",
"sourceKind": "url",
"varKey": "DATABASE_URL"
},
"note": ""
}

Illustrative values · selected fields

Authorization

An account key with access, or a project/service key with variables:write. The resource must be within the key’s project, service, and environment scope.

Authorization: Bearer <key> Key setup ↗

Path parameters

id string required

The CONSUMING service id (the app that needs the value). Databases can't consume references.

Request body

providerId string required

The service being referenced (e.g. the database).

sourceKind string optional

Which value to pull: "url" (default; full connection URL), "host", "host-port", "public-url" (web-facing services only), or "var:NAME" to copy a specific env var from the provider.

varKey string optional

Env var name to inject into the consumer. Optional — defaults to a natural name for the provider.

Response 201

Returns the new reference and an optional note. Redeploy the consumer to receive the injected environment value.

Examples show selected response fields with illustrative values. Your response can contain additional fields.

reference object

New reference linking a consumer to a provider.

Child fields
  • id string

    Unique identifier of this resource.

  • consumerId string
  • providerId string
  • sourceKind string
  • varKey string
note string

Additional information about the result; can be empty.

Errors

400

Invalid parameters. Check the required fields, types, and resource configuration.

401

The API key is missing, invalid, or revoked.

403

The caller or key scope does not permit this operation.

404

The resource does not exist or is not visible to this caller.

409

The current resource state prevents the operation. Inspect it before retrying.

Error handling and safe retries
ALSO AVAILABLE VIA MCP

add_reference

Required MCP arguments: id, providerId. Send path, query, and body fields together as tool arguments.

Connect your agent ↗