The purpose of this API is to access the ConfigCat platform programmatically. You can Create, Read, Update and Delete any entities like Feature Flags, Configs, Environments or Products within ConfigCat.
Base API URL: https://test-api.configcat.com
If you prefer the swagger documentation, you can find it here: Swagger UI.
The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON format.
Important: Do not use this API for accessing and evaluating feature flag values. Use the SDKs or the ConfigCat Proxy instead.
The complete specification is publicly available in the following formats:
You can use it to generate client libraries in various languages with OpenAPI Generator or Swagger Codegen to interact with this API.
This API uses the Basic HTTP Authentication Scheme.
All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers:
Header | Description |
---|---|
X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. |
X-Rate-Limit-Reset | The time when the current rate limit period resets. |
When the rate limit is exceeded by a request, the API returns with a HTTP 429 - Too many requests
status along with a Retry-After
HTTP header.
This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.
- API version: v1
- Package version: 1.0.0
- Generator version: 7.9.0
- Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit https://configcat.com
Install the following dependencies:
go get github.com/stretchr/testify/assert
go get golang.org/x/net/context
Put the package under your project folder and add the following in import:
import configcatpublicapi "github.com/configcat/configcat-publicapi-go-client/v2"
To use a proxy, set the environment variable HTTP_PROXY
:
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
Default configuration comes with Servers
field that contains server objects as defined in the OpenAPI specification.
For using other server than the one defined on index 0 set context value configcatpublicapi.ContextServerIndex
of type int
.
ctx := context.WithValue(context.Background(), configcatpublicapi.ContextServerIndex, 1)
Templated server URL is formatted using default variables from configuration or from context value configcatpublicapi.ContextServerVariables
of type map[string]string
.
ctx := context.WithValue(context.Background(), configcatpublicapi.ContextServerVariables, map[string]string{
"basePath": "v2",
})
Note, enum values are always validated and all unused variables are silently ignored.
Each operation can use different server URL defined using OperationServers
map in the Configuration
.
An operation is uniquely identified by "{classname}Service.{nickname}"
string.
Similar rules for overriding default operation server index and variables applies by using configcatpublicapi.ContextOperationServerIndices
and configcatpublicapi.ContextOperationServerVariables
context maps.
ctx := context.WithValue(context.Background(), configcatpublicapi.ContextOperationServerIndices, map[string]int{
"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), configcatpublicapi.ContextOperationServerVariables, map[string]map[string]string{
"{classname}Service.{nickname}": {
"port": "8443",
},
})
All URIs are relative to https://test-api.configcat.com
Class | Method | HTTP request | Description |
---|---|---|---|
AuditLogsAPI | GetAuditlogs | Get /v1/products/{productId}/auditlogs | List Audit log items for Product |
AuditLogsAPI | GetDeletedSettings | Get /v1/configs/{configId}/deleted-settings | List Deleted Settings |
AuditLogsAPI | GetOrganizationAuditlogs | Get /v1/organizations/{organizationId}/auditlogs | List Audit log items for Organization |
CodeReferencesAPI | V1CodeReferencesDeleteReportsPost | Post /v1/code-references/delete-reports | Delete Reference reports |
CodeReferencesAPI | V1CodeReferencesPost | Post /v1/code-references | Upload References |
CodeReferencesAPI | V1SettingsSettingIdCodeReferencesGet | Get /v1/settings/{settingId}/code-references | Get References for Feature Flag or Setting |
ConfigsAPI | CreateConfig | Post /v1/products/{productId}/configs | Create Config |
ConfigsAPI | DeleteConfig | Delete /v1/configs/{configId} | Delete Config |
ConfigsAPI | GetConfig | Get /v1/configs/{configId} | Get Config |
ConfigsAPI | GetConfigs | Get /v1/products/{productId}/configs | List Configs |
ConfigsAPI | UpdateConfig | Put /v1/configs/{configId} | Update Config |
EnvironmentsAPI | CreateEnvironment | Post /v1/products/{productId}/environments | Create Environment |
EnvironmentsAPI | DeleteEnvironment | Delete /v1/environments/{environmentId} | Delete Environment |
EnvironmentsAPI | GetEnvironment | Get /v1/environments/{environmentId} | Get Environment |
EnvironmentsAPI | GetEnvironments | Get /v1/products/{productId}/environments | List Environments |
EnvironmentsAPI | UpdateEnvironment | Put /v1/environments/{environmentId} | Update Environment |
FeatureFlagSettingValuesAPI | GetSettingValue | Get /v1/environments/{environmentId}/settings/{settingId}/value | Get value |
FeatureFlagSettingValuesAPI | GetSettingValues | Get /v1/configs/{configId}/environments/{environmentId}/values | Get values |
FeatureFlagSettingValuesAPI | PostSettingValues | Post /v1/configs/{configId}/environments/{environmentId}/values | Post values |
FeatureFlagSettingValuesAPI | ReplaceSettingValue | Put /v1/environments/{environmentId}/settings/{settingId}/value | Replace value |
FeatureFlagSettingValuesAPI | UpdateSettingValue | Patch /v1/environments/{environmentId}/settings/{settingId}/value | Update value |
FeatureFlagSettingValuesUsingSDKKeyAPI | GetSettingValueBySdkkey | Get /v1/settings/{settingKeyOrId}/value | Get value |
FeatureFlagSettingValuesUsingSDKKeyAPI | ReplaceSettingValueBySdkkey | Put /v1/settings/{settingKeyOrId}/value | Replace value |
FeatureFlagSettingValuesUsingSDKKeyAPI | UpdateSettingValueBySdkkey | Patch /v1/settings/{settingKeyOrId}/value | Update value |
FeatureFlagSettingValuesUsingSDKKeyV2API | GetSettingValueBySdkkeyV2 | Get /v2/settings/{settingKeyOrId}/value | Get value |
FeatureFlagSettingValuesUsingSDKKeyV2API | ReplaceSettingValueBySdkkeyV2 | Put /v2/settings/{settingKeyOrId}/value | Replace value |
FeatureFlagSettingValuesUsingSDKKeyV2API | UpdateSettingValueBySdkkeyV2 | Patch /v2/settings/{settingKeyOrId}/value | Update value |
FeatureFlagSettingValuesV2API | GetSettingValueV2 | Get /v2/environments/{environmentId}/settings/{settingId}/value | Get value |
FeatureFlagSettingValuesV2API | GetSettingValuesV2 | Get /v2/configs/{configId}/environments/{environmentId}/values | Get values |
FeatureFlagSettingValuesV2API | PostSettingValuesV2 | Post /v2/configs/{configId}/environments/{environmentId}/values | Post values |
FeatureFlagSettingValuesV2API | ReplaceSettingValueV2 | Put /v2/environments/{environmentId}/settings/{settingId}/value | Replace value |
FeatureFlagSettingValuesV2API | UpdateSettingValueV2 | Patch /v2/environments/{environmentId}/settings/{settingId}/value | Update value |
FeatureFlagsSettingsAPI | CreateSetting | Post /v1/configs/{configId}/settings | Create Flag |
FeatureFlagsSettingsAPI | DeleteSetting | Delete /v1/settings/{settingId} | Delete Flag |
FeatureFlagsSettingsAPI | GetSetting | Get /v1/settings/{settingId} | Get Flag |
FeatureFlagsSettingsAPI | GetSettings | Get /v1/configs/{configId}/settings | List Flags |
FeatureFlagsSettingsAPI | ReplaceSetting | Put /v1/settings/{settingId} | Replace Flag |
FeatureFlagsSettingsAPI | UpdateSetting | Patch /v1/settings/{settingId} | Update Flag |
IntegrationLinksAPI | AddOrUpdateIntegrationLink | Post /v1/environments/{environmentId}/settings/{settingId}/integrationLinks/{integrationLinkType}/{key} | Add or update Integration link |
IntegrationLinksAPI | DeleteIntegrationLink | Delete /v1/environments/{environmentId}/settings/{settingId}/integrationLinks/{integrationLinkType}/{key} | Delete Integration link |
IntegrationLinksAPI | GetIntegrationLinkDetails | Get /v1/integrationLink/{integrationLinkType}/{key}/details | Get Integration link |
IntegrationLinksAPI | JiraAddOrUpdateIntegrationLink | Post /v1/jira/environments/{environmentId}/settings/{settingId}/integrationLinks/{key} | |
IntegrationLinksAPI | JiraConnect | Post /v1/jira/connect | |
IntegrationsAPI | CreateIntegration | Post /v1/products/{productId}/integrations | Create Integration |
IntegrationsAPI | DeleteIntegration | Delete /v1/integrations/{integrationId} | Delete Integration |
IntegrationsAPI | GetIntegration | Get /v1/integrations/{integrationId} | Get Integration |
IntegrationsAPI | GetIntegrations | Get /v1/products/{productId}/integrations | List Integrations |
IntegrationsAPI | UpdateIntegration | Put /v1/integrations/{integrationId} | Update Integration |
MeAPI | GetMe | Get /v1/me | Get authenticated user details |
MembersAPI | AddMemberToGroup | Post /v1/organizations/{organizationId}/members/{userId} | Update Member Permissions |
MembersAPI | DeleteInvitation | Delete /v1/invitations/{invitationId} | Delete Invitation |
MembersAPI | DeleteOrganizationMember | Delete /v1/organizations/{organizationId}/members/{userId} | Delete Member from Organization |
MembersAPI | DeleteProductMember | Delete /v1/products/{productId}/members/{userId} | Delete Member from Product |
MembersAPI | GetOrganizationMembers | Get /v1/organizations/{organizationId}/members | List Organization Members |
MembersAPI | GetOrganizationMembersV2 | Get /v2/organizations/{organizationId}/members | List Organization Members |
MembersAPI | GetPendingInvitations | Get /v1/products/{productId}/invitations | List Pending Invitations in Product |
MembersAPI | GetPendingInvitationsOrg | Get /v1/organizations/{organizationId}/invitations | List Pending Invitations in Organization |
MembersAPI | GetProductMembers | Get /v1/products/{productId}/members | List Product Members |
MembersAPI | InviteMember | Post /v1/products/{productId}/members/invite | Invite Member |
OrganizationsAPI | GetOrganizations | Get /v1/organizations | List Organizations |
PermissionGroupsAPI | CreatePermissionGroup | Post /v1/products/{productId}/permissions | Create Permission Group |
PermissionGroupsAPI | DeletePermissionGroup | Delete /v1/permissions/{permissionGroupId} | Delete Permission Group |
PermissionGroupsAPI | GetPermissionGroup | Get /v1/permissions/{permissionGroupId} | Get Permission Group |
PermissionGroupsAPI | GetPermissionGroups | Get /v1/products/{productId}/permissions | List Permission Groups |
PermissionGroupsAPI | UpdatePermissionGroup | Put /v1/permissions/{permissionGroupId} | Update Permission Group |
ProductsAPI | CreateProduct | Post /v1/organizations/{organizationId}/products | Create Product |
ProductsAPI | DeleteProduct | Delete /v1/products/{productId} | Delete Product |
ProductsAPI | GetProduct | Get /v1/products/{productId} | Get Product |
ProductsAPI | GetProductPreferences | Get /v1/products/{productId}/preferences | Get Product Preferences |
ProductsAPI | GetProducts | Get /v1/products | List Products |
ProductsAPI | UpdateProduct | Put /v1/products/{productId} | Update Product |
ProductsAPI | UpdateProductPreferences | Post /v1/products/{productId}/preferences | Update Product Preferences |
SDKKeysAPI | GetSdkKeys | Get /v1/configs/{configId}/environments/{environmentId} | Get SDK Key |
SegmentsAPI | CreateSegment | Post /v1/products/{productId}/segments | Create Segment |
SegmentsAPI | DeleteSegment | Delete /v1/segments/{segmentId} | Delete Segment |
SegmentsAPI | GetSegment | Get /v1/segments/{segmentId} | Get Segment |
SegmentsAPI | GetSegments | Get /v1/products/{productId}/segments | List Segments |
SegmentsAPI | UpdateSegment | Put /v1/segments/{segmentId} | Update Segment |
TagsAPI | CreateTag | Post /v1/products/{productId}/tags | Create Tag |
TagsAPI | DeleteTag | Delete /v1/tags/{tagId} | Delete Tag |
TagsAPI | GetSettingsByTag | Get /v1/tags/{tagId}/settings | List Settings by Tag |
TagsAPI | GetTag | Get /v1/tags/{tagId} | Get Tag |
TagsAPI | GetTags | Get /v1/products/{productId}/tags | List Tags |
TagsAPI | UpdateTag | Put /v1/tags/{tagId} | Update Tag |
WebhooksAPI | CreateWebhook | Post /v1/configs/{configId}/environments/{environmentId}/webhooks | Create Webhook |
WebhooksAPI | DeleteWebhook | Delete /v1/webhooks/{webhookId} | Delete Webhook |
WebhooksAPI | GetWebhook | Get /v1/webhooks/{webhookId} | Get Webhook |
WebhooksAPI | GetWebhookSigningKeys | Get /v1/webhooks/{webhookId}/keys | Get Webhook Signing Keys |
WebhooksAPI | GetWebhooks | Get /v1/products/{productId}/webhooks | List Webhooks |
WebhooksAPI | ReplaceWebhook | Put /v1/webhooks/{webhookId} | Replace Webhook |
WebhooksAPI | UpdateWebhook | Patch /v1/webhooks/{webhookId} | Update Webhook |
- AccessType
- AddOrUpdateIntegrationLinkModel
- AddOrUpdateJiraIntegrationLinkModel
- AuditLogItemModel
- AuditLogType
- CodeReferenceModel
- CodeReferenceRequest
- ComparisonValueListModel
- ComparisonValueModel
- ConditionModel
- ConfigModel
- ConfigSettingFormulaModel
- ConfigSettingFormulasModel
- ConfigSettingValueModel
- ConfigSettingValuesModel
- ConnectRequest
- CreateConfigRequest
- CreateEnvironmentModel
- CreateIntegrationModel
- CreateOrUpdateEnvironmentAccessModel
- CreatePermissionGroupRequest
- CreateProductRequest
- CreateSegmentModel
- CreateSettingInitialValues
- CreateTagModel
- DeleteIntegrationLinkModel
- DeleteRepositoryReportsRequest
- EnvironmentAccessModel
- EnvironmentAccessType
- EnvironmentModel
- EvaluationVersion
- FeatureFlagLimitations
- FlagReference
- InitialValue
- IntegrationLinkDetail
- IntegrationLinkDetailsModel
- IntegrationLinkModel
- IntegrationLinkType
- IntegrationModel
- IntegrationType
- IntegrationsModel
- InvitationModel
- InviteMembersRequest
- JsonPatchOperation
- KeyGenerationMode
- MeModel
- MemberModel
- ModifyIntegrationRequest
- OperationType
- OrganizationAdminModel
- OrganizationInvitationModel
- OrganizationMemberModel
- OrganizationMembersModel
- OrganizationModel
- OrganizationPermissionGroupModel
- OrganizationPermissionModel
- OrganizationProductModel
- PercentageOptionModel
- PermissionGroupModel
- PreferencesModel
- PrerequisiteComparator
- PrerequisiteFlagConditionModel
- ProductModel
- ReasonRequiredEnvironmentModel
- ReferenceLine
- ReferenceLines
- ReplaceSettingModel
- RolloutPercentageItemModel
- RolloutRuleComparator
- RolloutRuleModel
- SdkKeysModel
- SegmentComparator
- SegmentConditionModel
- SegmentListModel
- SegmentModel
- SettingDataModel
- SettingFormulaModel
- SettingModel
- SettingTagModel
- SettingType
- SettingValueModel
- TagModel
- TargetingRuleModel
- UpdateConfigRequest
- UpdateEnvironmentModel
- UpdateEvaluationFormulaModel
- UpdateEvaluationFormulaWithIdModel
- UpdateEvaluationFormulasModel
- UpdateMemberPermissionsRequest
- UpdatePermissionGroupRequest
- UpdatePreferencesRequest
- UpdateProductRequest
- UpdateReasonRequiredEnvironmentModel
- UpdateSegmentModel
- UpdateSettingValueModel
- UpdateSettingValueWithSettingIdModel
- UpdateSettingValuesWithIdModel
- UpdateTagModel
- UserComparator
- UserConditionModel
- UserModel
- ValueModel
- WebHookHttpMethod
- WebHookRequest
- WebhookConfig
- WebhookEnvironment
- WebhookHeaderModel
- WebhookModel
- WebhookSigningKeysModel
Authentication schemes defined for the API:
- Type: HTTP basic authentication
Example
auth := context.WithValue(context.Background(), configcatpublicapi.ContextBasicAuth, configcatpublicapi.BasicAuth{
UserName: "username",
Password: "password",
})
r, err := client.Service.Operation(auth, args)
Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:
PtrBool
PtrInt
PtrInt32
PtrInt64
PtrFloat
PtrFloat32
PtrFloat64
PtrString
PtrTime