Skip to content

Replace a flag's targeting in an environment

A whole-config write; the console always sends If-Match with the config's ETag. 400 for an unknown variation or segment, or when a comment is required and missing; 400 snapshot_too_large when the environment's compiled snapshot would exceed 8 MB.

PUT
https://flags-api.ezghcloud.com/v1/organizations/{orgId}/projects/{projectId}/flags/{flagId}/environments/{environmentId}

Authorization

  • apiKeyoptionalHTTP
  • oauthoptionalHTTP
  • sessionCookieoptionalAPI key in cookie

Path parameters

  • orgIdstringrequired
    format: uuid
  • projectIdstringrequired
    format: uuid
  • flagIdstringrequired
    format: uuid
  • environmentIdstringrequired
    format: uuid

Header parameters

  • If-Matchoptionalstring

    The ETag as last read, or *. Without it the write isn't conditional; with a stale one it's 412.

Request bodyJSONrequired

  • defaultServeobjectrequired

    Exactly one of variation and rollout.

    2 properties
    • rolloutoptionalobject
      2 properties
      • weightsarray ofobjectrequired

        Weights sum to exactly 100000 (0.001 % steps).

        2 properties
        • variationstringrequired

          Lowercase letters, digits, _ and -, starting with a letter or digit; at most 64 characters. Immutable.

          pattern: ^[a-z0-9][a-z0-9_-]{0,63}$
        • weightintegerrequired
          maximum: 100000, minimum: 0
      • bucketByoptionalstring

        The context attribute to bucket on; targetingKey by default. A context without it gets the first variation.

    • variationoptionalstring

      Lowercase letters, digits, _ and -, starting with a letter or digit; at most 64 characters. Immutable.

      pattern: ^[a-z0-9][a-z0-9_-]{0,63}$
  • enabledbooleanrequired
  • offVariationstringrequired

    Lowercase letters, digits, _ and -, starting with a letter or digit; at most 64 characters. Immutable.

    pattern: ^[a-z0-9][a-z0-9_-]{0,63}$
  • rulesarray ofobjectrequired
    4 properties
    • clausesarray ofobjectrequired

      ANDed; at most 10.

      3 properties
      • operatorinornotInorcontainsorstartsWithorendsWithorlt+8 morerequired
      • valuesarray ofstring | number | booleanrequired

        Strings, numbers or booleans (booleans with in and notIn); segment keys for the segment operators. At most 1,000.

      • attributeoptionalstring

        A context attribute; dot paths reach nested ones (company.plan). Absent for segmentMatch and notSegmentMatch.

    • idstringrequired
      format: uuid
    • serveobjectrequired

      Exactly one of variation and rollout.

      2 properties
      • rolloutoptionalobject
        2 properties
        • weightsarray ofobjectrequired

          Weights sum to exactly 100000 (0.001 % steps).

          2 properties
          • variationstringrequired

            Lowercase letters, digits, _ and -, starting with a letter or digit; at most 64 characters. Immutable.

            pattern: ^[a-z0-9][a-z0-9_-]{0,63}$
          • weightintegerrequired
            maximum: 100000, minimum: 0
        • bucketByoptionalstring

          The context attribute to bucket on; targetingKey by default. A context without it gets the first variation.

      • variationoptionalstring

        Lowercase letters, digits, _ and -, starting with a letter or digit; at most 64 characters. Immutable.

        pattern: ^[a-z0-9][a-z0-9_-]{0,63}$
    • descriptionoptionalstring
      maxLength: 200
  • targetsarray ofobjectrequired
    2 properties
    • valuesarray ofstringrequired
    • variationstringrequired

      Lowercase letters, digits, _ and -, starting with a letter or digit; at most 64 characters. Immutable.

      pattern: ^[a-z0-9][a-z0-9_-]{0,63}$
  • commentoptionalstring

    Kept with the version; required when the environment's requireComment is true.

    maxLength: 1000

Returns

200

The config, at its new version.

JSON
  • accessobjectrequired
    1 properties
    • updatebooleanrequired

      Whether the caller may change this flag's targeting in this environment (flags.configs.update).

  • defaultServeobjectrequired

    Exactly one of variation and rollout.

    2 properties
    • rolloutoptionalobject
      2 properties
      • weightsarray ofobjectrequired

        Weights sum to exactly 100000 (0.001 % steps).

        2 properties
        • variationstringrequired

          Lowercase letters, digits, _ and -, starting with a letter or digit; at most 64 characters. Immutable.

          pattern: ^[a-z0-9][a-z0-9_-]{0,63}$
        • weightintegerrequired
          maximum: 100000, minimum: 0
      • bucketByoptionalstring

        The context attribute to bucket on; targetingKey by default. A context without it gets the first variation.

    • variationoptionalstring

      Lowercase letters, digits, _ and -, starting with a letter or digit; at most 64 characters. Immutable.

      pattern: ^[a-z0-9][a-z0-9_-]{0,63}$
  • enabledbooleanrequired
  • environmentIdstringrequired
    format: uuid
  • environmentKeystringrequired

    Lowercase letters, digits, _ and -, starting with a letter or digit; at most 64 characters. Immutable.

    pattern: ^[a-z0-9][a-z0-9_-]{0,63}$
  • flagIdstringrequired
    format: uuid
  • flagKeystringrequired

    Lowercase letters, digits, _ and -, starting with a letter or digit; at most 64 characters. Immutable.

    pattern: ^[a-z0-9][a-z0-9_-]{0,63}$
  • offVariationstringrequired

    Lowercase letters, digits, _ and -, starting with a letter or digit; at most 64 characters. Immutable.

    pattern: ^[a-z0-9][a-z0-9_-]{0,63}$
  • rulesarray ofobjectrequired
    4 properties
    • clausesarray ofobjectrequired

      ANDed; at most 10.

      3 properties
      • operatorinornotInorcontainsorstartsWithorendsWithorlt+8 morerequired
      • valuesarray ofstring | number | booleanrequired

        Strings, numbers or booleans (booleans with in and notIn); segment keys for the segment operators. At most 1,000.

      • attributeoptionalstring

        A context attribute; dot paths reach nested ones (company.plan). Absent for segmentMatch and notSegmentMatch.

    • idstringrequired
      format: uuid
    • serveobjectrequired

      Exactly one of variation and rollout.

      2 properties
      • rolloutoptionalobject
        2 properties
        • weightsarray ofobjectrequired

          Weights sum to exactly 100000 (0.001 % steps).

          2 properties
          • variationstringrequired

            Lowercase letters, digits, _ and -, starting with a letter or digit; at most 64 characters. Immutable.

            pattern: ^[a-z0-9][a-z0-9_-]{0,63}$
          • weightintegerrequired
            maximum: 100000, minimum: 0
        • bucketByoptionalstring

          The context attribute to bucket on; targetingKey by default. A context without it gets the first variation.

      • variationoptionalstring

        Lowercase letters, digits, _ and -, starting with a letter or digit; at most 64 characters. Immutable.

        pattern: ^[a-z0-9][a-z0-9_-]{0,63}$
    • descriptionoptionalstring
      maxLength: 200
  • targetsarray ofobjectrequired
    2 properties
    • valuesarray ofstringrequired
    • variationstringrequired

      Lowercase letters, digits, _ and -, starting with a letter or digit; at most 64 characters. Immutable.

      pattern: ^[a-z0-9][a-z0-9_-]{0,63}$
  • updatedAtstringrequired
    format: date-time
  • versionintegerrequired

400

invalid_request (with issues), invalid_cursor, or the endpoint's own 400 codes.

JSON
  • errorobjectrequired
    4 properties
    • codestringrequired
      maxLength: 64, pattern: ^[a-z][a-z0-9_]*$
    • messagestringrequired
      maxLength: 1024
    • issuesoptionalarray ofobject

      invalid_request: one entry per problem, at a dotted path.

      2 properties
      • messagestringrequired
      • pathstringrequired
    • quotaoptionalobject

      quota_exceeded: the quota that refused the request. Never with Retry-After.

      11 properties
      • idstringrequired
      • kindallocationorrateorusageorconcurrencyrequired
      • limitintegerrequired
        minimum: 0
      • scopeorganizationorprojectorresourcerequired
      • inFlightoptionalinteger
        minimum: 0
      • periodStartoptionalstring
        format: date-time
      • regionoptionalstring
      • resetsAtoptionalstring
        format: date-time
      • scopeResourceNameoptionalstring
      • usedoptionalinteger
        minimum: 0
      • windowoptionalstring

        rate only: an ISO 8601 duration, PT1S to PT1H.

401

unauthenticated: no credential, or one that doesn't check out.

JSON
  • errorobjectrequired
    4 properties
    • codestringrequired
      maxLength: 64, pattern: ^[a-z][a-z0-9_]*$
    • messagestringrequired
      maxLength: 1024
    • issuesoptionalarray ofobject

      invalid_request: one entry per problem, at a dotted path.

      2 properties
      • messagestringrequired
      • pathstringrequired
    • quotaoptionalobject

      quota_exceeded: the quota that refused the request. Never with Retry-After.

      11 properties
      • idstringrequired
      • kindallocationorrateorusageorconcurrencyrequired
      • limitintegerrequired
        minimum: 0
      • scopeorganizationorprojectorresourcerequired
      • inFlightoptionalinteger
        minimum: 0
      • periodStartoptionalstring
        format: date-time
      • regionoptionalstring
      • resetsAtoptionalstring
        format: date-time
      • scopeResourceNameoptionalstring
      • usedoptionalinteger
        minimum: 0
      • windowoptionalstring

        rate only: an ISO 8601 duration, PT1S to PT1H.

403

access_denied: the caller's policies don't allow the action; forbidden_origin: a cookie-authenticated write from an origin that isn't allowed; spend_limit_reached.

JSON
  • errorobjectrequired
    4 properties
    • codestringrequired
      maxLength: 64, pattern: ^[a-z][a-z0-9_]*$
    • messagestringrequired
      maxLength: 1024
    • issuesoptionalarray ofobject

      invalid_request: one entry per problem, at a dotted path.

      2 properties
      • messagestringrequired
      • pathstringrequired
    • quotaoptionalobject

      quota_exceeded: the quota that refused the request. Never with Retry-After.

      11 properties
      • idstringrequired
      • kindallocationorrateorusageorconcurrencyrequired
      • limitintegerrequired
        minimum: 0
      • scopeorganizationorprojectorresourcerequired
      • inFlightoptionalinteger
        minimum: 0
      • periodStartoptionalstring
        format: date-time
      • regionoptionalstring
      • resetsAtoptionalstring
        format: date-time
      • scopeResourceNameoptionalstring
      • usedoptionalinteger
        minimum: 0
      • windowoptionalstring

        rate only: an ISO 8601 duration, PT1S to PT1H.

404

not_found: unknown, malformed, or in an organization the caller isn't in.

JSON
  • errorobjectrequired
    4 properties
    • codestringrequired
      maxLength: 64, pattern: ^[a-z][a-z0-9_]*$
    • messagestringrequired
      maxLength: 1024
    • issuesoptionalarray ofobject

      invalid_request: one entry per problem, at a dotted path.

      2 properties
      • messagestringrequired
      • pathstringrequired
    • quotaoptionalobject

      quota_exceeded: the quota that refused the request. Never with Retry-After.

      11 properties
      • idstringrequired
      • kindallocationorrateorusageorconcurrencyrequired
      • limitintegerrequired
        minimum: 0
      • scopeorganizationorprojectorresourcerequired
      • inFlightoptionalinteger
        minimum: 0
      • periodStartoptionalstring
        format: date-time
      • regionoptionalstring
      • resetsAtoptionalstring
        format: date-time
      • scopeResourceNameoptionalstring
      • usedoptionalinteger
        minimum: 0
      • windowoptionalstring

        rate only: an ISO 8601 duration, PT1S to PT1H.

409

quota_exceeded (an allocation quota, with quota), idempotency_conflict, idempotency_in_progress (with Retry-After), organization_deletion_pending, operation_in_progress, or the endpoint's own 409 codes.

JSON
  • errorobjectrequired
    4 properties
    • codestringrequired
      maxLength: 64, pattern: ^[a-z][a-z0-9_]*$
    • messagestringrequired
      maxLength: 1024
    • issuesoptionalarray ofobject

      invalid_request: one entry per problem, at a dotted path.

      2 properties
      • messagestringrequired
      • pathstringrequired
    • quotaoptionalobject

      quota_exceeded: the quota that refused the request. Never with Retry-After.

      11 properties
      • idstringrequired
      • kindallocationorrateorusageorconcurrencyrequired
      • limitintegerrequired
        minimum: 0
      • scopeorganizationorprojectorresourcerequired
      • inFlightoptionalinteger
        minimum: 0
      • periodStartoptionalstring
        format: date-time
      • regionoptionalstring
      • resetsAtoptionalstring
        format: date-time
      • scopeResourceNameoptionalstring
      • usedoptionalinteger
        minimum: 0
      • windowoptionalstring

        rate only: an ISO 8601 duration, PT1S to PT1H.

412

precondition_failed: it changed since the If-Match ETag was read. Nothing was changed.

JSON
  • errorobjectrequired
    4 properties
    • codestringrequired
      maxLength: 64, pattern: ^[a-z][a-z0-9_]*$
    • messagestringrequired
      maxLength: 1024
    • issuesoptionalarray ofobject

      invalid_request: one entry per problem, at a dotted path.

      2 properties
      • messagestringrequired
      • pathstringrequired
    • quotaoptionalobject

      quota_exceeded: the quota that refused the request. Never with Retry-After.

      11 properties
      • idstringrequired
      • kindallocationorrateorusageorconcurrencyrequired
      • limitintegerrequired
        minimum: 0
      • scopeorganizationorprojectorresourcerequired
      • inFlightoptionalinteger
        minimum: 0
      • periodStartoptionalstring
        format: date-time
      • regionoptionalstring
      • resetsAtoptionalstring
        format: date-time
      • scopeResourceNameoptionalstring
      • usedoptionalinteger
        minimum: 0
      • windowoptionalstring

        rate only: an ISO 8601 duration, PT1S to PT1H.

413

payload_too_large: the body is over the endpoint's limit (1 MiB unless it says otherwise).

JSON
  • errorobjectrequired
    4 properties
    • codestringrequired
      maxLength: 64, pattern: ^[a-z][a-z0-9_]*$
    • messagestringrequired
      maxLength: 1024
    • issuesoptionalarray ofobject

      invalid_request: one entry per problem, at a dotted path.

      2 properties
      • messagestringrequired
      • pathstringrequired
    • quotaoptionalobject

      quota_exceeded: the quota that refused the request. Never with Retry-After.

      11 properties
      • idstringrequired
      • kindallocationorrateorusageorconcurrencyrequired
      • limitintegerrequired
        minimum: 0
      • scopeorganizationorprojectorresourcerequired
      • inFlightoptionalinteger
        minimum: 0
      • periodStartoptionalstring
        format: date-time
      • regionoptionalstring
      • resetsAtoptionalstring
        format: date-time
      • scopeResourceNameoptionalstring
      • usedoptionalinteger
        minimum: 0
      • windowoptionalstring

        rate only: an ISO 8601 duration, PT1S to PT1H.

429

too_many_requests, with Retry-After; or quota_exceeded (a rate, usage or concurrency quota, with quota), never with Retry-After.

JSON
  • errorobjectrequired
    4 properties
    • codestringrequired
      maxLength: 64, pattern: ^[a-z][a-z0-9_]*$
    • messagestringrequired
      maxLength: 1024
    • issuesoptionalarray ofobject

      invalid_request: one entry per problem, at a dotted path.

      2 properties
      • messagestringrequired
      • pathstringrequired
    • quotaoptionalobject

      quota_exceeded: the quota that refused the request. Never with Retry-After.

      11 properties
      • idstringrequired
      • kindallocationorrateorusageorconcurrencyrequired
      • limitintegerrequired
        minimum: 0
      • scopeorganizationorprojectorresourcerequired
      • inFlightoptionalinteger
        minimum: 0
      • periodStartoptionalstring
        format: date-time
      • regionoptionalstring
      • resetsAtoptionalstring
        format: date-time
      • scopeResourceNameoptionalstring
      • usedoptionalinteger
        minimum: 0
      • windowoptionalstring

        rate only: an ISO 8601 duration, PT1S to PT1H.

500

internal_error: a bug; the details are in the logs, under the request ID.

JSON
  • errorobjectrequired
    4 properties
    • codestringrequired
      maxLength: 64, pattern: ^[a-z][a-z0-9_]*$
    • messagestringrequired
      maxLength: 1024
    • issuesoptionalarray ofobject

      invalid_request: one entry per problem, at a dotted path.

      2 properties
      • messagestringrequired
      • pathstringrequired
    • quotaoptionalobject

      quota_exceeded: the quota that refused the request. Never with Retry-After.

      11 properties
      • idstringrequired
      • kindallocationorrateorusageorconcurrencyrequired
      • limitintegerrequired
        minimum: 0
      • scopeorganizationorprojectorresourcerequired
      • inFlightoptionalinteger
        minimum: 0
      • periodStartoptionalstring
        format: date-time
      • regionoptionalstring
      • resetsAtoptionalstring
        format: date-time
      • scopeResourceNameoptionalstring
      • usedoptionalinteger
        minimum: 0
      • windowoptionalstring

        rate only: an ISO 8601 duration, PT1S to PT1H.

503

unavailable: a dependency the request needs is down. Retry after Retry-After.

JSON
  • errorobjectrequired
    4 properties
    • codestringrequired
      maxLength: 64, pattern: ^[a-z][a-z0-9_]*$
    • messagestringrequired
      maxLength: 1024
    • issuesoptionalarray ofobject

      invalid_request: one entry per problem, at a dotted path.

      2 properties
      • messagestringrequired
      • pathstringrequired
    • quotaoptionalobject

      quota_exceeded: the quota that refused the request. Never with Retry-After.

      11 properties
      • idstringrequired
      • kindallocationorrateorusageorconcurrencyrequired
      • limitintegerrequired
        minimum: 0
      • scopeorganizationorprojectorresourcerequired
      • inFlightoptionalinteger
        minimum: 0
      • periodStartoptionalstring
        format: date-time
      • regionoptionalstring
      • resetsAtoptionalstring
        format: date-time
      • scopeResourceNameoptionalstring
      • usedoptionalinteger
        minimum: 0
      • windowoptionalstring

        rate only: an ISO 8601 duration, PT1S to PT1H.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close