Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
1328 lines (1327 sloc) 28.5 KB
{
"swagger": "2.0",
"info": {
"title": "Flipt REST API",
"version": "latest"
},
"schemes": [
"http",
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/api/v1/evaluate": {
"post": {
"operationId": "Evaluate",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/fliptEvaluationResponse"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/fliptEvaluationRequest"
}
}
],
"tags": [
"Evaluation"
]
}
},
"/api/v1/flags": {
"get": {
"operationId": "ListFlags",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/fliptFlagList"
}
}
},
"parameters": [
{
"name": "limit",
"in": "query",
"required": false,
"type": "integer",
"format": "int32"
},
{
"name": "offset",
"in": "query",
"required": false,
"type": "integer",
"format": "int32"
}
],
"tags": [
"Flags"
]
},
"post": {
"operationId": "CreateFlag",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/fliptFlag"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/fliptCreateFlagRequest"
}
}
],
"tags": [
"Flags"
]
}
},
"/api/v1/flags/{flag_key}/rules": {
"get": {
"operationId": "ListRules",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/fliptRuleList"
}
}
},
"parameters": [
{
"name": "flag_key",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "limit",
"in": "query",
"required": false,
"type": "integer",
"format": "int32"
},
{
"name": "offset",
"in": "query",
"required": false,
"type": "integer",
"format": "int32"
}
],
"tags": [
"Rules"
]
},
"post": {
"operationId": "CreateRule",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/fliptRule"
}
}
},
"parameters": [
{
"name": "flag_key",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/fliptCreateRuleRequest"
}
}
],
"tags": [
"Rules"
]
}
},
"/api/v1/flags/{flag_key}/rules/order": {
"put": {
"operationId": "OrderRules",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"properties": {}
}
}
},
"parameters": [
{
"name": "flag_key",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/fliptOrderRulesRequest"
}
}
],
"tags": [
"Rules"
]
}
},
"/api/v1/flags/{flag_key}/rules/{id}": {
"get": {
"operationId": "GetRule",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/fliptRule"
}
}
},
"parameters": [
{
"name": "flag_key",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "id",
"in": "path",
"required": true,
"type": "string"
}
],
"tags": [
"Rules"
]
},
"delete": {
"operationId": "DeleteRule",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"properties": {}
}
}
},
"parameters": [
{
"name": "flag_key",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "id",
"in": "path",
"required": true,
"type": "string"
}
],
"tags": [
"Rules"
]
},
"put": {
"operationId": "UpdateRule",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/fliptRule"
}
}
},
"parameters": [
{
"name": "flag_key",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "id",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/fliptUpdateRuleRequest"
}
}
],
"tags": [
"Rules"
]
}
},
"/api/v1/flags/{flag_key}/rules/{rule_id}/distributions": {
"post": {
"operationId": "CreateDistribution",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/fliptDistribution"
}
}
},
"parameters": [
{
"name": "flag_key",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "rule_id",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/fliptCreateDistributionRequest"
}
}
],
"tags": [
"Distributions"
]
}
},
"/api/v1/flags/{flag_key}/rules/{rule_id}/distributions/{id}": {
"delete": {
"operationId": "DeleteDistribution",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"properties": {}
}
}
},
"parameters": [
{
"name": "flag_key",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "rule_id",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "id",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "variant_id",
"in": "query",
"required": false,
"type": "string"
}
],
"tags": [
"Distributions"
]
},
"put": {
"operationId": "UpdateDistribution",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/fliptDistribution"
}
}
},
"parameters": [
{
"name": "flag_key",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "rule_id",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "id",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/fliptUpdateDistributionRequest"
}
}
],
"tags": [
"Distributions"
]
}
},
"/api/v1/flags/{flag_key}/variants": {
"post": {
"operationId": "CreateVariant",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/fliptVariant"
}
}
},
"parameters": [
{
"name": "flag_key",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/fliptCreateVariantRequest"
}
}
],
"tags": [
"Variants"
]
}
},
"/api/v1/flags/{flag_key}/variants/{id}": {
"delete": {
"operationId": "DeleteVariant",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"properties": {}
}
}
},
"parameters": [
{
"name": "flag_key",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "id",
"in": "path",
"required": true,
"type": "string"
}
],
"tags": [
"Variants"
]
},
"put": {
"operationId": "UpdateVariant",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/fliptVariant"
}
}
},
"parameters": [
{
"name": "flag_key",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "id",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/fliptUpdateVariantRequest"
}
}
],
"tags": [
"Variants"
]
}
},
"/api/v1/flags/{key}": {
"get": {
"operationId": "GetFlag",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/fliptFlag"
}
}
},
"parameters": [
{
"name": "key",
"in": "path",
"required": true,
"type": "string"
}
],
"tags": [
"Flags"
]
},
"delete": {
"operationId": "DeleteFlag",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"properties": {}
}
}
},
"parameters": [
{
"name": "key",
"in": "path",
"required": true,
"type": "string"
}
],
"tags": [
"Flags"
]
},
"put": {
"operationId": "UpdateFlag",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/fliptFlag"
}
}
},
"parameters": [
{
"name": "key",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/fliptUpdateFlagRequest"
}
}
],
"tags": [
"Flags"
]
}
},
"/api/v1/segments": {
"get": {
"operationId": "ListSegments",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/fliptSegmentList"
}
}
},
"parameters": [
{
"name": "limit",
"in": "query",
"required": false,
"type": "integer",
"format": "int32"
},
{
"name": "offset",
"in": "query",
"required": false,
"type": "integer",
"format": "int32"
}
],
"tags": [
"Segments"
]
},
"post": {
"operationId": "CreateSegment",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/fliptSegment"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/fliptCreateSegmentRequest"
}
}
],
"tags": [
"Segments"
]
}
},
"/api/v1/segments/{key}": {
"get": {
"operationId": "GetSegment",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/fliptSegment"
}
}
},
"parameters": [
{
"name": "key",
"in": "path",
"required": true,
"type": "string"
}
],
"tags": [
"Segments"
]
},
"delete": {
"operationId": "DeleteSegment",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"properties": {}
}
}
},
"parameters": [
{
"name": "key",
"in": "path",
"required": true,
"type": "string"
}
],
"tags": [
"Segments"
]
},
"put": {
"operationId": "UpdateSegment",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/fliptSegment"
}
}
},
"parameters": [
{
"name": "key",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/fliptUpdateSegmentRequest"
}
}
],
"tags": [
"Segments"
]
}
},
"/api/v1/segments/{segment_key}/constraints": {
"post": {
"operationId": "CreateConstraint",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/fliptConstraint"
}
}
},
"parameters": [
{
"name": "segment_key",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/fliptCreateConstraintRequest"
}
}
],
"tags": [
"Constraints"
]
}
},
"/api/v1/segments/{segment_key}/constraints/{id}": {
"delete": {
"operationId": "DeleteConstraint",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"properties": {}
}
}
},
"parameters": [
{
"name": "segment_key",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "id",
"in": "path",
"required": true,
"type": "string"
}
],
"tags": [
"Constraints"
]
},
"put": {
"operationId": "UpdateConstraint",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/fliptConstraint"
}
}
},
"parameters": [
{
"name": "segment_key",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "id",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/fliptUpdateConstraintRequest"
}
}
],
"tags": [
"Constraints"
]
}
}
},
"definitions": {
"fliptComparisonType": {
"type": "string",
"enum": [
"UNKNOWN_COMPARISON_TYPE",
"STRING_COMPARISON_TYPE",
"NUMBER_COMPARISON_TYPE",
"BOOLEAN_COMPARISON_TYPE"
],
"default": "UNKNOWN_COMPARISON_TYPE"
},
"fliptConstraint": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"segment_key": {
"type": "string"
},
"type": {
"$ref": "#/definitions/fliptComparisonType"
},
"property": {
"type": "string"
},
"operator": {
"type": "string"
},
"value": {
"type": "string"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"updated_at": {
"type": "string",
"format": "date-time"
}
}
},
"fliptCreateConstraintRequest": {
"type": "object",
"properties": {
"segment_key": {
"type": "string"
},
"type": {
"$ref": "#/definitions/fliptComparisonType"
},
"property": {
"type": "string"
},
"operator": {
"type": "string"
},
"value": {
"type": "string"
}
}
},
"fliptCreateDistributionRequest": {
"type": "object",
"properties": {
"flag_key": {
"type": "string"
},
"rule_id": {
"type": "string"
},
"variant_id": {
"type": "string"
},
"rollout": {
"type": "number",
"format": "float"
}
}
},
"fliptCreateFlagRequest": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"enabled": {
"type": "boolean",
"format": "boolean"
}
}
},
"fliptCreateRuleRequest": {
"type": "object",
"properties": {
"flag_key": {
"type": "string"
},
"segment_key": {
"type": "string"
},
"rank": {
"type": "integer",
"format": "int32"
}
}
},
"fliptCreateSegmentRequest": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
}
}
},
"fliptCreateVariantRequest": {
"type": "object",
"properties": {
"flag_key": {
"type": "string"
},
"key": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
}
}
},
"fliptDistribution": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"rule_id": {
"type": "string"
},
"variant_id": {
"type": "string"
},
"rollout": {
"type": "number",
"format": "float"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"updated_at": {
"type": "string",
"format": "date-time"
}
}
},
"fliptEvaluationRequest": {
"type": "object",
"properties": {
"request_id": {
"type": "string"
},
"flag_key": {
"type": "string"
},
"entity_id": {
"type": "string"
},
"context": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
},
"fliptEvaluationResponse": {
"type": "object",
"properties": {
"request_id": {
"type": "string"
},
"entity_id": {
"type": "string"
},
"request_context": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"match": {
"type": "boolean",
"format": "boolean"
},
"flag_key": {
"type": "string"
},
"segment_key": {
"type": "string"
},
"timestamp": {
"type": "string",
"format": "date-time"
},
"value": {
"type": "string"
},
"request_duration_millis": {
"type": "number",
"format": "double"
}
}
},
"fliptFlag": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"enabled": {
"type": "boolean",
"format": "boolean"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"updated_at": {
"type": "string",
"format": "date-time"
},
"variants": {
"type": "array",
"items": {
"$ref": "#/definitions/fliptVariant"
}
}
}
},
"fliptFlagList": {
"type": "object",
"properties": {
"flags": {
"type": "array",
"items": {
"$ref": "#/definitions/fliptFlag"
}
}
}
},
"fliptOrderRulesRequest": {
"type": "object",
"properties": {
"flag_key": {
"type": "string"
},
"rule_ids": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"fliptRule": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"flag_key": {
"type": "string"
},
"segment_key": {
"type": "string"
},
"distributions": {
"type": "array",
"items": {
"$ref": "#/definitions/fliptDistribution"
}
},
"rank": {
"type": "integer",
"format": "int32"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"updated_at": {
"type": "string",
"format": "date-time"
}
}
},
"fliptRuleList": {
"type": "object",
"properties": {
"rules": {
"type": "array",
"items": {
"$ref": "#/definitions/fliptRule"
}
}
}
},
"fliptSegment": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"updated_at": {
"type": "string",
"format": "date-time"
},
"constraints": {
"type": "array",
"items": {
"$ref": "#/definitions/fliptConstraint"
}
}
}
},
"fliptSegmentList": {
"type": "object",
"properties": {
"segments": {
"type": "array",
"items": {
"$ref": "#/definitions/fliptSegment"
}
}
}
},
"fliptUpdateConstraintRequest": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"segment_key": {
"type": "string"
},
"type": {
"$ref": "#/definitions/fliptComparisonType"
},
"property": {
"type": "string"
},
"operator": {
"type": "string"
},
"value": {
"type": "string"
}
}
},
"fliptUpdateDistributionRequest": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"flag_key": {
"type": "string"
},
"rule_id": {
"type": "string"
},
"variant_id": {
"type": "string"
},
"rollout": {
"type": "number",
"format": "float"
}
}
},
"fliptUpdateFlagRequest": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"enabled": {
"type": "boolean",
"format": "boolean"
}
}
},
"fliptUpdateRuleRequest": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"flag_key": {
"type": "string"
},
"segment_key": {
"type": "string"
}
}
},
"fliptUpdateSegmentRequest": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
}
}
},
"fliptUpdateVariantRequest": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"flag_key": {
"type": "string"
},
"key": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
}
}
},
"fliptVariant": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"flag_key": {
"type": "string"
},
"key": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"updated_at": {
"type": "string",
"format": "date-time"
}
}
}
}
}
You can’t perform that action at this time.