This API is documented in OpenAPI format and describe the REST API of the GO Feature Flag relay proxy.
The relay proxy is a component to evaluate your feature flags remotely when using GO Feature Flag.
This API is mostly used by all the OpenFeature providers.
This endpoint is used to force the refresh of the flags in the cache.
This endpoint is used to force the refresh of the flags in the cache. This endpoint is used when you know explicitly that a flag has changed, and you want to trigger the collection of the new versions.
Authorizations:
Responses
Response samples
- 200
- 400
- 500
{- "refreshed": true
}
pprof endpoint
This endpoint is provided by the echo pprof middleware. To know more please check this blogpost from the GO team https://go.dev/blog/pprof. Visit the page /debug/pprof/ to see the available endpoints, all endpoint are not in the swagger documentation because they are standard pprof endpoints. This endpoint is only available in debug mode.
Responses
Info
Making a GET request to the URL path /info
will give you information about the actual state
of the relay proxy.
As of Today the level of information is small be we can improve this endpoint to returns more information.
Responses
Response samples
- 200
{- "cacheRefresh": "2022-06-13T11:22:55.941628+02:00"
}
OFREP provider configuration
OFREP configuration to provide information about the remote flag management system, to configure the OpenFeature SDK providers.
This endpoint will be called during the initialization of the provider.
Authorizations:
header Parameters
If-None-Match | string The request will be processed only if ETag doesn't match. |
Responses
Response samples
- 200
- 304
- 401
- 404
- 500
{- "capabilities": {
- "cacheInvalidation": {
- "polling": {
- "enabled": true,
- "minPollingInterval": 0
}
}, - "flagEvaluation": {
- "unsupportedTypes": [
- "string"
]
}
}, - "name": "string"
}
Open-Feature Remote Evaluation Protocol bulk evaluation API.
Making a POST request to the URL /ofrep/v1/evaluate/flags
will give you the value of the list
of feature flags for this evaluation context.
If no flags are provided, the API will evaluate all available flags in the configuration.
Authorizations:
header Parameters
If-None-Match | string The request will be processed only if ETag doesn't match. |
Request Body schema: application/jsonrequired
Evaluation Context and list of flag for this API call
object |
Responses
Request samples
- Payload
{- "context": {
- "company": "GO Feature Flag",
- "firstname": "John",
- "lastname": "Doe",
- "targetingKey": "4f433951-4c8c-42b3-9f18-8c9a5ed8e9eb"
}
}
Response samples
- 200
- 304
- 400
- 401
- 403
- 500
{- "flags": [
- {
- "errorCode": "string",
- "errorDetails": "string",
- "key": "string",
- "metadata": {
- "property1": null,
- "property2": null
}, - "reason": "string",
- "value": null,
- "variant": "string"
}
]
}
Evaluate a feature flag using the OpenFeature Remote Evaluation Protocol
Making a POST request to the URL /ofrep/v1/evaluate/flags/{your_flag_name}
will give you the
value of the flag for this evaluation context
Authorizations:
path Parameters
flag_key required | string Name of your feature flag |
Request Body schema: application/jsonrequired
Evaluation Context for this API call
object |
Responses
Request samples
- Payload
{- "context": {
- "company": "GO Feature Flag",
- "firstname": "John",
- "lastname": "Doe",
- "targetingKey": "4f433951-4c8c-42b3-9f18-8c9a5ed8e9eb"
}
}
Response samples
- 200
- 400
- 401
- 404
- 500
{- "key": "string",
- "metadata": {
- "property1": null,
- "property2": null
}, - "reason": "string",
- "value": null,
- "variant": "string"
}
All flags variations for a user
Making a POST request to the URL /v1/allflags
will give you the values of all the flags for
this user.
To get a variation you should provide information about the user. For that you should provide some user information in JSON in the request body.
Authorizations:
Request Body schema: application/jsonrequired
Payload of the user we want to challenge against the flag.
object EvaluationContext The representation of a EvaluationContext for your feature flag system. |
Responses
Request samples
- Payload
{- "evaluationContext": {
- "custom": {
- "company": "GO Feature Flag",
- "email": "contact@gofeatureflag.org",
- "firstname": "John",
- "lastname": "Doe"
}, - "key": "08b5ffb7-7109-42f4-a6f2-b85560fbd20f"
}
}
Response samples
- 200
- 400
- 500
{- "flags": {
- "property1": {
- "timestamp": 1652113076,
- "trackEvents": false,
- "value": null,
- "variationType": "variation-A"
}, - "property2": {
- "timestamp": 1652113076,
- "trackEvents": false,
- "value": null,
- "variationType": "variation-A"
}
}, - "valid": false
}
Endpoint to send usage of your flags to be collected
This endpoint is receiving the events of your flags usage to send them in the data collector.
It is used by the different Open Feature providers to send in bulk all the cached events to avoid to lose track of what happen when a cached flag is used.
Authorizations:
Request Body schema: application/jsonrequired
List of flag evaluation that be passed to the data exporter
Array of objects (exporter.FeatureEvent) Events is the list of the event we send in the payload | |
object Meta are the extra information added during the configuration |
Responses
Request samples
- Payload
{- "events": [
- {
- "contextKind": "user",
- "creationDate": 1680246000011,
- "default": false,
- "key": "my-feature-flag",
- "kind": "feature",
- "metadata": { },
- "source": "SERVER",
- "userKey": "94a25909-20d8-40cc-8500-fee99b569345",
- "value": null,
- "variation": "admin-variation",
- "version": "v1.0.0"
}
], - "meta": { }
}
Response samples
- 200
- 400
- 500
{- "ingestedContentCount": 0
}
Evaluate a feature flag
Making a POST request to the URL /v1/feature/<your_flag_name>/eval
will give you the value of the
flag for this user.
To get a variation you should provide information about the user:
- User information in JSON in the request body.
- A default value in case there is an error while evaluating the flag.
Note that you will always have a usable value in the response, you can use the field failed
to know if
an issue has occurred during the validation of the flag, in that case the value returned will be the
default value.
Authorizations:
path Parameters
flag_key required | string Name of your feature flag |
Request Body schema: application/jsonrequired
Payload of the user we want to get all the flags from.
defaultValue | any The value will we use if we are not able to get the variation of the flag. |
object EvaluationContext The representation of a EvaluationContext for your feature flag system. |
Responses
Request samples
- Payload
{- "defaultValue": null,
- "evaluationContext": {
- "custom": {
- "company": "GO Feature Flag",
- "email": "contact@gofeatureflag.org",
- "firstname": "John",
- "lastname": "Doe"
}, - "key": "08b5ffb7-7109-42f4-a6f2-b85560fbd20f"
}
}
Response samples
- 200
- 400
- 500
{- "errorCode": "",
- "failed": false,
- "metadata": { },
- "reason": "TARGETING_MATCH",
- "trackEvents": true,
- "value": null,
- "variationType": "variation-A",
- "version": "1.0"
}
Endpoint to poll if you want to know if there is a configuration change in the flags
Making a GET request to the URL /v1/flag/change
will give you the hash of the current
configuration, you can use this hash to know if the configuration has changed.
Authorizations:
header Parameters
If-None-Match | string The request will be processed only if ETag doesn't match. |
Responses
Response samples
- 200
- 304
- 500
{- "flags": {
- "property1": 0,
- "property2": 0
}, - "hash": 0
}
Websocket endpoint to be notified about flag changes
This endpoint is a websocket endpoint to be notified about flag changes, every change will send a request to the client with a model.DiffCache format.
query Parameters
apiKey | string apiKey use authorize the connection to the relay proxy |
Responses
Response samples
- 200
- 400
- 500
{- "added": {
- "property1": {
- "defValue": "string",
- "name": "string",
- "usage": "string",
- "value": null
}, - "property2": {
- "defValue": "string",
- "name": "string",
- "usage": "string",
- "value": null
}
}, - "deleted": {
- "property1": {
- "defValue": "string",
- "name": "string",
- "usage": "string",
- "value": null
}, - "property2": {
- "defValue": "string",
- "name": "string",
- "usage": "string",
- "value": null
}
}, - "updated": {
- "property1": {
- "new_value": {
- "defValue": "string",
- "name": "string",
- "usage": "string",
- "value": null
}, - "old_value": {
- "defValue": "string",
- "name": "string",
- "usage": "string",
- "value": null
}
}, - "property2": {
- "new_value": {
- "defValue": "string",
- "name": "string",
- "usage": "string",
- "value": null
}, - "old_value": {
- "defValue": "string",
- "name": "string",
- "usage": "string",
- "value": null
}
}
}
}