Configuration API reference

    This endpoint lets you get configuration from a store.

    URL Parameters

    Query Parameters

    If no query parameters are provided, all configuration items are returned. To specify the keys of the configuration items to get, use one or more key query parameters. For example:

    1. GET http://localhost:<daprPort>/v1.0-alpha1/configuration/mystore?key=config1&key=config2

    To retrieve all configuration items:

    1. GET http://localhost:<daprPort>/v1.0-alpha1/configuration/mystore

    Request Body

    None

    HTTP Response

    Response Codes

    CodeDescription
    204Get operation successful
    400Configuration store is missing or misconfigured or malformed request
    500Failed to get configuration

    Response Body

    JSON-encoded value of key/value pairs for each configuration item.

    Example

    1. curl -X GET 'http://localhost:3500/v1.0-alpha1/configuration/mystore?key=myConfigKey'
    1. [{"key":"myConfigKey","value":"myConfigValue"}]

    This endpoint lets you subscribe to configuration changes. Notifications happen when values are updated or deleted in the configuration store. This enables the application to react to configuration changes.

    URL Parameters

    Query Parameters

    If no query parameters are provided, all configuration items are subscribed to. To specify the keys of the configuration items to subscribe to, use one or more key query parameters. For example:

    1. GET http://localhost:<daprPort>/v1.0-alpha1/configuration/mystore/subscribe?key=config1&key=config2

    To subscribe to all changes:

      Request Body

      None

      HTTP Response

      Response Codes

      CodeDescription
      Subscribe operation successful
      400Configuration store is missing or misconfigured or malformed request
      500Failed to subscribe to configuration changes

      Response Body

      JSON-encoded value

      Example

      1. curl -X GET 'http://localhost:3500/v1.0-alpha1/configuration/mystore/subscribe?key=myConfigKey'
      1. {
      2. "id": "<unique-id>"
      3. }

      The returned id parameter can be used to unsubscribe to the specific set of keys provided on the subscribe API call. This should be retained by the application.

      This endpoint lets you unsubscribe to configuration changes.

      URL Parameters

      Query Parameters

      None

      Request Body

      None

      HTTP Response

      Response Codes

      CodeDescription
      200Unsubscribe operation successful
      400Configuration store is missing or misconfigured or malformed request
      500Failed to unsubscribe to configuration changes

      Response Body

      1. {
      2. }

      Example

      1. curl -X GET 'http://localhost:3500/v1.0-alpha1/configuration/mystore/bf3aa454-312d-403c-af95-6dec65058fa2/unsubscribe'

      subscribing to configuration changes, Dapr invokes the application whenever a configuration item changes. Your application can have a /configuration endpoint that is called for all key updates that are subscribed to. The endpoint(s) can be made more specific for a given configuration store by adding /<store-name> and for a specific key by adding /<store-name>/<key> to the route.

      HTTP Request

      1. POST http://localhost:<appPort>/configuration/<store-name>/<key>

      URL Parameters

      Request Body

      1. {
      2. "id": "<subscription-id>",
      3. "items": [
      4. "key": "<key-of-configuration-item>",
      5. "value": "<new-value>",
      6. "version": "<version-of-item>"
      7. }

      Example