DevCycle OpenFeature Remote Evaluation API (OFREP) API
See the OpenFeature documentation for more information: https://github.com/open-feature/protocol
See the OpenFeature documentation for more information: https://github.com/open-feature/protocol
openapi: 3.1.0
info:
title: DevCycle Bucketing Audiences OpenFeature Remote Evaluation API (OFREP) API
description: Documents the DevCycle Bucketing API which provides an API interface to User Bucketing and for Server SDKs configured to use Cloud Bucketing.
version: 1.3.0
servers:
- url: https://bucketing-api.devcycle.com/
tags:
- name: OpenFeature Remote Evaluation API (OFREP)
description: 'See the OpenFeature documentation for more information: https://github.com/open-feature/protocol'
paths:
/ofrep/v1/evaluate/flags/{key}:
post:
tags:
- OpenFeature Remote Evaluation API (OFREP)
summary: OFREP Single Flag Evaluation Request
description: Return a single flag for a user context
parameters:
- name: key
in: path
required: true
schema:
type: string
pattern: ^[a-z0-9-_.]+$
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ofrep-evaluationRequest'
responses:
'200':
description: OFREP successful evaluation response
content:
application/json:
schema:
$ref: '#/components/schemas/ofrep-evaluationSuccess'
'400':
description: Bad evaluation request
content:
application/json:
schema:
$ref: '#/components/schemas/ofrep-evaluationFailure'
'404':
description: Flag not found
content:
application/json:
schema:
$ref: '#/components/schemas/ofrep-flagNotFound'
'401':
description: Unauthorized - You need credentials to access the API
'403':
description: Forbidden - You are not authorized to access the API
'429':
description: Rate limit reached on the Flag Management System
headers:
Retry-Later:
description: Indicates when to retry the request again
schema:
type: string
format: date-time
examples:
- '2024-02-07T12:00:00Z'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ofrep-generalErrorResponse'
/ofrep/v1/evaluate/flags:
post:
tags:
- OpenFeature Remote Evaluation API (OFREP)
summary: OFREP Bulk Evaluation Request
description: Return all flag values for a user context.
parameters:
- in: header
name: If-None-Match
description: The request will be processed only if ETag doesn't match any of the values listed.
schema:
type: string
required: false
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ofrep-bulkEvaluationRequest'
responses:
'200':
description: OFREP successful evaluation response
headers:
ETag:
schema:
type: string
description: Entity tag used for cache validation
content:
application/json:
schema:
$ref: '#/components/schemas/ofrep-bulkEvaluationSuccess'
'304':
description: Bulk evaluation is not modified
'400':
description: Bad evaluation request
content:
application/json:
schema:
$ref: '#/components/schemas/ofrep-bulkEvaluationFailure'
'401':
description: Unauthorized - You need credentials to access the API
'403':
description: Forbidden - You are not authorized to access the API
'429':
description: Rate limit reached on the Flag Management System
headers:
Retry-Later:
description: Indicates when to retry the request again
schema:
type: string
format: date-time
examples:
- '2024-02-07T12:00:00Z'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ofrep-generalErrorResponse'
components:
schemas:
ofrep-stringFlag:
description: A string typed flag value
properties:
value:
type: string
description: Flag evaluation result
examples:
- my-flag-value
required:
- value
ofrep-bulkEvaluationRequest:
description: Evaluate multiple flags in one request
properties:
context:
$ref: '#/components/schemas/ofrep-context'
ofrep-booleanFlag:
description: A boolean typed flag value
properties:
value:
type: boolean
description: Flag evaluation result
required:
- value
ofrep-key:
type: string
pattern: ^[a-z0-9-_.]+$
description: Feature flag key
examples:
- my-flag
ofrep-generalErrorResponse:
description: A general error response from the service
properties:
errorDetails:
$ref: '#/components/schemas/ofrep-errorDetails'
ofrep-floatFlag:
description: A float typed flag value
properties:
value:
type: number
description: Flag evaluation result
examples:
- 3.1415
required:
- value
ofrep-bulkEvaluationFailure:
description: Bulk evaluation failure response
properties:
errorCode:
type: string
description: An appropriate code specific to the bulk evaluation error. See https://openfeature.dev/specification/types#error-code
errorDetails:
type: string
description: Optional error details description for logging or other needs
required:
- errorCode
ofrep-evaluationFailure:
description: Flag evaluation failure response
properties:
key:
$ref: '#/components/schemas/ofrep-key'
errorCode:
type: string
enum:
- PARSE_ERROR
- TARGETING_KEY_MISSING
- INVALID_CONTEXT
- GENERAL
description: OpenFeature compatible error code. See https://openfeature.dev/specification/types#error-code
errorDetails:
$ref: '#/components/schemas/ofrep-errorDetails'
required:
- key
- errorCode
ofrep-context:
type: object
description: Context information for flag evaluation
ofrep-evaluationSuccess:
description: Flag evaluation success response.
allOf:
- properties:
key:
$ref: '#/components/schemas/ofrep-key'
reason:
type: string
enum:
- STATIC
- TARGETING_MATCH
- SPLIT
- DISABLED
- UNKNOWN
description: An OpenFeature reason for the evaluation
variant:
type: string
description: Variant of the evaluated flag value
metadata:
type: object
description: Arbitrary metadata supporting flag evaluation
- oneOf:
- $ref: '#/components/schemas/ofrep-booleanFlag'
- $ref: '#/components/schemas/ofrep-stringFlag'
- $ref: '#/components/schemas/ofrep-integerFlag'
- $ref: '#/components/schemas/ofrep-floatFlag'
- $ref: '#/components/schemas/ofrep-objectFlag'
ofrep-errorDetails:
type: string
description: An error description for logging or other needs
ofrep-bulkEvaluationSuccess:
description: Success response for the bulk evaluation request
type: object
properties:
flags:
type: array
items:
oneOf:
- $ref: '#/components/schemas/ofrep-evaluationSuccess'
- $ref: '#/components/schemas/ofrep-evaluationFailure'
ofrep-objectFlag:
description: An object typed flag value
properties:
value:
type: object
description: Flag evaluation result
required:
- value
ofrep-evaluationRequest:
description: Flag evaluation request
properties:
context:
$ref: '#/components/schemas/ofrep-context'
ofrep-flagNotFound:
description: Flag not found response
properties:
key:
$ref: '#/components/schemas/ofrep-key'
errorCode:
type: string
enum:
- FLAG_NOT_FOUND
errorDetails:
$ref: '#/components/schemas/ofrep-errorDetails'
required:
- key
- errorCode
ofrep-integerFlag:
description: An integer typed flag value
properties:
value:
type: integer
description: Flag evaluation result
examples:
- 3
required:
- value
securitySchemes:
bearerAuth:
type: apiKey
in: header
name: Authorization
description: Enter your DevCycle SDK token