Using property sets Stay organized with collections Save and categorize content based on your preferences.
This pageapplies toApigee andApigee hybrid.
View Apigee Edge documentation.![]()
Aproperty set is a custom collection of key/value pairsthat store data. API proxies can retrieve this data when they execute.
Why use property sets?
Typically, you use property sets to store non-expiring data that shouldn't behard-coded in your API proxy logic. You can access property set data anywhere in a proxy where youcan accessflow variables.
A common use case for property sets is to provide values that areassociated with one environment or another. For example, you cancreate an environment-scoped property set with configuration values that arespecific to proxies running in your test environment, and anotherset for your production environment.
For example:
- The
prod-env.propertiesproperty set contains the propertylog-level=error - The
test-env.propertiesproperty set contains the propertylog-level=debug
Similarly, you might store environment-specific routing information:
- The
test-env.propertiesproperty set contains the propertydb-url=mydomain.test.datasource.com - The
prod-env.propertiesproperty set contains the propertydb-url=mydomain.prod.datasource.com
Property set scopes
You can scope a property set to an API proxy revision or environment when you create the property set. You cannot scope a property set to an organization.
The following table explains the behavior and administration of property sets with API proxy and organization scope:
| Scope | Runtime behavior | Administration |
|---|---|---|
| API proxy | Properties are available only to the revision of the API proxy that contains the property set resource. No other API proxy or revision of the same proxy can access that particular property set. | Administrators can use the /resourcefiles Apigee API or the UI to create and edit property sets. Saving the API proxy in the UI will create a new revision, and the modified property set will be associated with that revision only. |
| Environment | Properties are available to all revisions of all API proxies within that environment. API proxies within other environments cannot access that property set. | Administrators must use the /resourcefiles Apigee API to create, view, update or delete environment-scoped property sets. These property sets are not displayed and cannot be edited in the Apigee UI. |
Property set limits
Apigee imposes limits on property sets, as described inLimits. In addition, property set files must use the samesyntax asJava propertiesfiles, with one exception: you cannot use curly braces{} in property set files.
Create property set files
Typically, you store property set values as name/value pairs in a file. Property set files areresource files of typeproperties.
Property set files support the same syntax asJava propertiesfiles; for example, they can contain Unicode values and can use# or!characters as comment markers. Note this one exception: you cannot use curly braces{} in property set files.
You must add the suffix.properties to a property file name. For example:myconfig.my_key.properties is allowed, butmyconfig.my_key is not allowed.
The structure of a property set specification is:property_set_name.property_name.properties The property set name and property name cannot have dots in them. For example:myconfig.my_key.properties is allowed, butmyconfig.my.key.properties andmy.config.my_key.properties are not allowed.
The following example shows a simple property set file that defines several properties:
# myProps.properties file# General propertiesfoo=barbaz=biff# Messages/notes/warningsmessage=This is a basic message.note_message=This is an important message.error_message=This is an error message.# Keyspublickey=abc123privatekey=splitwithsoundman
After you create a property set file, you upload it to Apigee using either theUI orAPI.
Manage property sets using the UI
Manage property sets scoped to an API proxy revision using the UI in the same way you manage other resources. For more information, seeManage resources using the UI.
Note:- You can create, update, or delete property sets scoped to an API proxy revision only if that revision has not been deployed. After an API proxy revision is deployed, it is immutable.
- You cannot manage property sets that are scoped to an organization or environment using the UI. For more information, seeProperty set scopes
Manage property sets using the API
Manage property sets scoped to an API proxy revision or environment using the API, as described in the following sections.
Create property sets using the API
The following sections describe how to create property sets scoped to an API proxy revision or environment using the API.
Create property sets scoped to an API proxy revision using the API
Note:You can add a property set scoped to an existing API proxy revision only if the revision has not been deployed. After an API proxy revision is deployed, it is immutable.To create a property set that is scoped to an API proxy revision using the API:
- Create the property set file.
- Add the property set file to anAPI proxy configuration bundle.
- Upload the bundle using theCreate API proxy orUpdate API proxy revision API.
Create property sets scoped to an environment using the API
To add a property set that is scoped to an environment using the API,create the property set file and then upload it to an environment in your organization by issuing aPOST request to the following resource:https://apigee.googleapis.com/v1/organizations/{org}/environments/{env}/resourcefiles
Include the following information with your request:
- Set the
namequery parameter to the name of the property set - Set the
typequery parameter toproperties - Pass the contents of the property set file as
application/octet-streamormultipart/form-data
chmod the file's permissions so that your development tool (suchascurl) can upload it.The following example imports a property set namedMyPropSet from the/Users/myhome/myprops.properties file:
curl -X POST "https://apigee.googleapis.com/v1/organizations/my-organization/environments/test/resourcefiles?name=MyPropSet&type=properties" -H "Authorization: Bearer $TOKEN" \ -H "Content-type: multipart/form-data" \ -F file=@/Users/myhome/myprops.properties$TOKEN is set to your OAuth 2.0 access token, as described inObtaining an OAuth 2.0 access token. For information about thecurl options used in this example, seeUsing curl.
The following provides an example of the response.
{ "name": "MyPropSet", "type": "properties"}For more information, seeCreate resource file API.
View property sets using the API
The following sections describe how to view property sets scoped to an environment using the API.
View all property sets scoped to an environment using the API
To view all property sets scoped to an environment using the API, issue aGET request to the following resource:https://apigee.googleapis.com/v1/organizations/{org}/environments/{env}/resourcefiles/properties
The following example lists all property sets in the test environment:
curl -X GET "https://apigee.googleapis.com/v1/organizations/my-organization/environments/test/resourcefiles/properties" \ -H "Authorization: Bearer $TOKEN"$TOKEN is set to your OAuth 2.0 access token, as described inObtaining an OAuth 2.0 access token. For information about thecurl options used in this example, seeUsing curl.
The following provides an example of the response.
{ "resourceFile": [ { "name": "MyPropSet", "type": "properties" } ]}For more information, seeList environment resource files API.
View the contents of a property set scoped to an environment using the API
To view the contents of a property set scoped to an environment using the API, issue aGET request to the following resource:https://apigee.googleapis.com/v1/organizations/{org}/environments/{env}/resourcefiles/properties/name
The following example displays the contents of theMyPropSet property set in the test environment:
curl -X GET "https://apigee.googleapis.com/v1/organizations/my-organization/environments/test/resourcefiles/properties/MyPropSet" \ -H "Authorization: Bearer $TOKEN"$TOKEN is set to your OAuth 2.0 access token, as described inObtaining an OAuth 2.0 access token. For information about thecurl options used in this example, seeUsing curl.
The following provides an example of the response.
# myProps.properties file# General propertiesfoo=barbaz=biff# Messages/notes/warningsmessage=This is a basic message.note_message=This is an important message.error_message=This is an error message.# Keyspublickey=abc123privatekey=splitwithsoundmanFor more information, seeList environment resource files API.
Update property sets using the API
The following sections describe how to update property sets scoped to an API proxy revision or environment using the API.
Update property sets scoped to an API proxy revision using the API
Note:You can update a property set scoped to an API proxy revision only if the revision has not been deployed. After an API proxy revision is deployed, it is immutable.To update a property set that is scoped to an API proxy revision using the API:
- Update theproperty set file.
- Download the API proxy configuration bundle using theGet API proxy revision API with the following options:
- Set the
formatquery parameter tobundle - Set the
Acceptheader toapplication/zip
- Set the
- Add the property set file to theAPI proxy configuration bundle.
- Upload the API proxy configuration bundle using theUpdate API proxy revision API.
Update property sets scoped to an environment using the API
To update a property set that is scoped to an environment using the API, update theproperty set file and then upload it to an environment in your organization by issuing aPUT request to the following resource:https://apigee.googleapis.com/v1/organizations/{org}/environments/{env}/resourcefiles/{type}/{name}
Include the following information with your request:
- Set{type} to
properties - Set{name} to the name of the property set that you want to update
- Pass the contents of the property set file as
application/octet-streamormultipart/form-data
chmod the file's permissions so that your development tool (suchascurl) can upload it.The following example updates theMyPropSet property set using the contents of the/Users/myhome/myprops-revised.properties file:
curl -X PUT "https://apigee.googleapis.com/v1/organizations/my-organization/environments/test/resourcefiles/properties/MyPropSet" -H "Authorization: Bearer $TOKEN" \ -H "Content-type: multipart/form-data" \ -F file=@/Users/myhome/myprops-revised.properties$TOKEN is set to your OAuth 2.0 access token, as described inObtaining an OAuth 2.0 access token. For information about thecurl options used in this example, seeUsing curl.
The following provides an example of the response.
{ "name": "MyPropSet", "type": "properties"}For more information, seeUpdate resource file API.
Delete property sets using the API
The following sections describe how to delete property sets scoped to an API proxy revision or environment using the API.
Delete property sets scoped to an API proxy revision using the API
Note:You can delete a property set scoped to an API proxy revision if it has not been deployed. After an API proxy revision is deployed, it is immutable.To delete a property set that is scoped to an API proxy revision using the API:
- Download the API proxy configuration bundle using theGet API proxy revision API with the following options:
- Set the
formatquery parameter tobundle - Set the
Acceptheader toapplication/zip
- Set the
- Delete the property set file from theAPI proxy configuration bundle.
- Upload the API proxy configuration bundle using theUpdate API proxy revision API.
Delete property sets scoped to an environment using the API
To delete a property set scoped to an environment using the API, issue aDELETE request to the following resource:https://apigee.googleapis.com/v1/organizations/{org}/environments/{env}/resourcefiles/{type}/{name}
Pass the following information with your request:
- Set{type} to
properties - Set{name} to the name of the property set that you want to delete
The following example deletes theMyPropSet property set:
curl -X DELETE https://apigee.googleapis.com/v1/organizations/my-organization/environments/test/resourcefiles/properties/MyPropSet \ -H "Authorization: Bearer $TOKEN"
$TOKEN is set to your OAuth 2.0 access token, as described inObtaining an OAuth 2.0 access token. For information about thecurl options used in this example, seeUsing curl.
The following provides an example of the response.
{ "name": "MyPropSet", "type": "properties"}For more information, seeDelete resource file API.
Access property set values
Access property set values anywhere in an API proxy where youcan accessflow variables:in policies, flows, JavaScript code, and so on.
To access values in a property set, use the following syntax:
propertyset.[property_set_name].[property_name]
Where:
- property_set_name is the filename that you defined (if you used the UI) or the value of the
namequery parameter (if you used the API). - property_name is the name of the property. For example, if your property set contains
foo=bar,foois the name of the property andbaris the value.
For example, in aJavaScript policy, use thegetVariable() method to get avalue from a property set:
context.getVariable('propertyset.property_set_name.property_name);The following example gets the value of thefoo property in the property setnamed "MyPropSet":
context.getVariable('propertyset.MyPropSet.foo);You can also use theExtractVariables policy to get the value of a property from a propertyset and assign it to another variable, as the following example shows:
<ExtractVariables name="ExtractVariables-1"> <DisplayName>Extract a portion of the url path</DisplayName> <Source>request</Source> <Variable name="propertyset.MyPropSet.foo"> <Pattern>{myVar}</Pattern> </Variable> <VariablePrefix>foobar</VariablePrefix> <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables></ExtractVariables> In this example, the policy reads the variable from the attributename, and assigns the value to the variable in thePattern element.
Assign the value of a property set key dynamically using the Assign Message policy
You can use the Assign Message policy to assign the value of property set key to a flow variabledynamically. For details,see thePropertySetRefdescription in the Assign Message policy reference.For Apigee hybrid users
If you are using Apigee hybrid, note the following:
- The hybrid management plane validates the property set; if valid, the properties are stored in the management plane.
- The Synchronizer retrieves the property set data and stores it locally on the runtime plane.
- The Message Processor loads the downloaded property set and makes it available to executing proxies.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-17 UTC.