# Update view

PATCH https://app.launchdarkly.com/api/v2/projects/{projectKey}/views/{viewKey}
Content-Type: application/json

Edit an existing view.

The request body must be a JSON object of the fields to update. The values you include replace the existing values for the fields.

Here's an example:
  ```
    {
      "description": "Example updated description",
      "tags": ["new-tag"]
    }
  ```


Reference: https://launchdarkly.com/docs/api/views-beta/update-view

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: LaunchDarkly REST API
  version: 1.0.0
paths:
  /api/v2/projects/{projectKey}/views/{viewKey}:
    patch:
      operationId: update-view
      summary: Update view
      description: >
        Edit an existing view.


        The request body must be a JSON object of the fields to update. The
        values you include replace the existing values for the fields.


        Here's an example:
          ```
            {
              "description": "Example updated description",
              "tags": ["new-tag"]
            }
          ```
      tags:
        - subpackage_viewsBeta
      parameters:
        - name: projectKey
          in: path
          required: true
          schema:
            type: string
        - name: viewKey
          in: path
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
        - name: LD-API-Version
          in: header
          description: Version of the endpoint.
          required: true
          schema:
            $ref: >-
              #/components/schemas/ApiV2ProjectsProjectKeyViewsViewKeyPatchParametersLdApiVersion
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/View'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      requestBody:
        description: A JSON representation of the view including only the fields to update.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ViewPatch'
servers:
  - url: https://app.launchdarkly.com
  - url: https://app.launchdarkly.us
components:
  schemas:
    ApiV2ProjectsProjectKeyViewsViewKeyPatchParametersLdApiVersion:
      type: string
      enum:
        - beta
      title: ApiV2ProjectsProjectKeyViewsViewKeyPatchParametersLdApiVersion
    ViewPatch:
      type: object
      properties:
        name:
          type: string
          description: Human-readable name for the view
        description:
          type: string
          description: Optional detailed description of the view
        generateSdkKeys:
          type: boolean
          description: Whether to generate SDK keys for this view
        maintainerId:
          type: string
          description: >-
            Member ID of the maintainer for this view. Only one of
            `maintainerId` or `maintainerTeamKey` can be specified.
        maintainerTeamKey:
          type: string
          description: >-
            Key of the maintainer team for this view. Only one of `maintainerId`
            or `maintainerTeamKey` can be specified.
        tags:
          type: array
          items:
            type: string
          description: Tags associated with this view
        archived:
          type: boolean
          description: Whether or not the view is archived
      title: ViewPatch
    ActionSpecifier:
      type: string
      title: ActionSpecifier
    ViewsAccessDeniedReasonEffect:
      type: string
      enum:
        - allow
        - deny
      description: Whether this statement should allow or deny actions on the resources.
      title: ViewsAccessDeniedReasonEffect
    ViewsAccessDeniedReason:
      type: object
      properties:
        resources:
          type: array
          items:
            type: string
          description: Resource specifier strings
        notResources:
          type: array
          items:
            type: string
          description: >-
            Targeted resources are the resources NOT in this list. The
            <code>resources</code> and <code>notActions</code> fields must be
            empty to use this field.
        actions:
          type: array
          items:
            $ref: '#/components/schemas/ActionSpecifier'
          description: Actions to perform on a resource
        notActions:
          type: array
          items:
            $ref: '#/components/schemas/ActionSpecifier'
          description: >-
            Targeted actions are the actions NOT in this list. The
            <code>actions</code> and <code>notResources</code> fields must be
            empty to use this field.
        effect:
          $ref: '#/components/schemas/ViewsAccessDeniedReasonEffect'
          description: >-
            Whether this statement should allow or deny actions on the
            resources.
        role_name:
          type: string
      required:
        - effect
      title: ViewsAccessDeniedReason
    ViewsAccessDenied:
      type: object
      properties:
        action:
          type: string
        reason:
          $ref: '#/components/schemas/ViewsAccessDeniedReason'
      required:
        - action
        - reason
      title: ViewsAccessDenied
    ViewsAccessAllowedReasonEffect:
      type: string
      enum:
        - allow
        - deny
      description: Whether this statement should allow or deny actions on the resources.
      title: ViewsAccessAllowedReasonEffect
    ViewsAccessAllowedReason:
      type: object
      properties:
        resources:
          type: array
          items:
            type: string
          description: Resource specifier strings
        notResources:
          type: array
          items:
            type: string
          description: >-
            Targeted resources are the resources NOT in this list. The
            <code>resources</code> and <code>notActions</code> fields must be
            empty to use this field.
        actions:
          type: array
          items:
            $ref: '#/components/schemas/ActionSpecifier'
          description: Actions to perform on a resource
        notActions:
          type: array
          items:
            $ref: '#/components/schemas/ActionSpecifier'
          description: >-
            Targeted actions are the actions NOT in this list. The
            <code>actions</code> and <code>notResources</code> fields must be
            empty to use this field.
        effect:
          $ref: '#/components/schemas/ViewsAccessAllowedReasonEffect'
          description: >-
            Whether this statement should allow or deny actions on the
            resources.
        role_name:
          type: string
      required:
        - effect
      title: ViewsAccessAllowedReason
    ViewsAccessAllowedRep:
      type: object
      properties:
        action:
          type: string
        reason:
          $ref: '#/components/schemas/ViewsAccessAllowedReason'
      required:
        - action
        - reason
      title: ViewsAccessAllowedRep
    ViewsAccessRep:
      type: object
      properties:
        denied:
          type: array
          items:
            $ref: '#/components/schemas/ViewsAccessDenied'
        allowed:
          type: array
          items:
            $ref: '#/components/schemas/ViewsAccessAllowedRep'
      required:
        - denied
        - allowed
      title: ViewsAccessRep
    CoreLink:
      type: object
      properties:
        href:
          type: string
        type:
          type: string
      required:
        - href
        - type
      title: CoreLink
    ParentAndSelfLinks:
      type: object
      properties:
        self:
          $ref: '#/components/schemas/CoreLink'
        parent:
          $ref: '#/components/schemas/CoreLink'
      required:
        - self
        - parent
      description: The location and content type of related resources
      title: ParentAndSelfLinks
    ViewsMaintainerMember:
      type: object
      properties:
        id:
          type: string
        email:
          type: string
        role:
          type: string
        firstName:
          type: string
        lastName:
          type: string
      required:
        - id
        - email
        - role
      title: ViewsMaintainerMember
    ViewsMaintainerTeam:
      type: object
      properties:
        id:
          type: string
        key:
          type: string
        name:
          type: string
      required:
        - id
        - key
        - name
      title: ViewsMaintainerTeam
    Maintainer:
      type: object
      properties:
        id:
          type: string
        kind:
          type: string
        maintainerMember:
          $ref: '#/components/schemas/ViewsMaintainerMember'
        maintainerTeam:
          $ref: '#/components/schemas/ViewsMaintainerTeam'
      required:
        - id
        - kind
      title: Maintainer
    ViewsSelfLink:
      type: object
      properties:
        self:
          $ref: '#/components/schemas/CoreLink'
      required:
        - self
      title: ViewsSelfLink
    ExpandedDirectlyLinkedFlag:
      type: object
      properties:
        key:
          type: string
        name:
          type: string
        links:
          $ref: '#/components/schemas/ViewsSelfLink'
      required:
        - key
        - name
        - links
      title: ExpandedDirectlyLinkedFlag
    ExpandedDirectlyLinkedFlags:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/ExpandedDirectlyLinkedFlag'
        totalCount:
          type: integer
      required:
        - items
        - totalCount
      title: ExpandedDirectlyLinkedFlags
    FlagsSummary:
      type: object
      properties:
        count:
          type: integer
        linkedFlags:
          $ref: '#/components/schemas/ExpandedDirectlyLinkedFlags'
      required:
        - count
      title: FlagsSummary
    ExpandedDirectlyLinkedSegment:
      type: object
      properties:
        key:
          type: string
        name:
          type: string
        environmentId:
          type: string
        links:
          $ref: '#/components/schemas/ViewsSelfLink'
      required:
        - key
        - name
        - environmentId
        - links
      title: ExpandedDirectlyLinkedSegment
    ExpandedDirectlyLinkedSegments:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/ExpandedDirectlyLinkedSegment'
        totalCount:
          type: integer
      required:
        - items
        - totalCount
      title: ExpandedDirectlyLinkedSegments
    SegmentsSummary:
      type: object
      properties:
        count:
          type: integer
        linkedSegments:
          $ref: '#/components/schemas/ExpandedDirectlyLinkedSegments'
      required:
        - count
      title: SegmentsSummary
    MetricsSummary:
      type: object
      properties:
        count:
          type: integer
      required:
        - count
      title: MetricsSummary
    AIConfigsSummary:
      type: object
      properties:
        count:
          type: integer
      required:
        - count
      title: AIConfigsSummary
    ResourceSummary:
      type: object
      properties:
        flagCount:
          type: integer
        segmentCount:
          type: integer
        totalCount:
          type: integer
      required:
        - flagCount
        - totalCount
      title: ResourceSummary
    ExpandedFlagMaintainerKind:
      type: string
      enum:
        - member
        - team
      description: The type of the maintainer
      title: ExpandedFlagMaintainerKind
    ViewsLink:
      type: object
      properties:
        href:
          type: string
        type:
          type: string
      title: ViewsLink
    ViewsMemberSummary:
      type: object
      properties:
        _links:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/ViewsLink'
          description: The location and content type of related resources
        _id:
          type: string
          description: The member's ID
        firstName:
          type: string
          description: The member's first name
        lastName:
          type: string
          description: The member's last name
        role:
          type: string
          description: >-
            The member's base role. If the member has no additional roles, this
            role will be in effect.
        email:
          type: string
          description: The member's email address
      required:
        - _links
        - _id
        - role
        - email
      title: ViewsMemberSummary
    ViewsMemberTeamSummaryRep:
      type: object
      properties:
        customRoleKeys:
          type: array
          items:
            type: string
          description: A list of keys of the custom roles this team has access to
        key:
          type: string
          description: The team key
        _links:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/ViewsLink'
        name:
          type: string
          description: The team name
      required:
        - customRoleKeys
        - key
        - name
      title: ViewsMemberTeamSummaryRep
    ExpandedFlagMaintainer:
      type: object
      properties:
        key:
          type: string
          description: The ID of the maintainer member, or the key of the maintainer team
        kind:
          $ref: '#/components/schemas/ExpandedFlagMaintainerKind'
          description: The type of the maintainer
        _member:
          $ref: '#/components/schemas/ViewsMemberSummary'
        _team:
          $ref: '#/components/schemas/ViewsMemberTeamSummaryRep'
      required:
        - key
        - kind
      title: ExpandedFlagMaintainer
    ExpandedFlag:
      type: object
      properties:
        key:
          type: string
          description: A unique key used to reference the flag
        name:
          type: string
          description: A human-friendly name for the flag
        description:
          type: string
          description: Description of the flag
        creationDate:
          type: integer
          format: int64
          description: Creation date in milliseconds
        _version:
          type: integer
          description: Version of the flag
        archived:
          type: boolean
          description: Whether the flag is archived
        tags:
          type: array
          items:
            type: string
          description: Tags for the flag
        temporary:
          type: boolean
          description: Whether the flag is temporary
        includeInSnippet:
          type: boolean
          description: Whether to include in snippet
        maintainer:
          $ref: '#/components/schemas/ExpandedFlagMaintainer'
        _links:
          $ref: '#/components/schemas/ParentAndSelfLinks'
      required:
        - key
        - name
      description: >-
        Flag representation for Views API - contains only fields actually used
        by the Views service
      title: ExpandedFlag
    ExpandedLinkedFlags:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/ExpandedFlag'
        totalCount:
          type: integer
      required:
        - items
        - totalCount
      description: >-
        Details on linked flags for a view - requires passing the 'allFlags'
        expand field
      title: ExpandedLinkedFlags
    ExpandedSegment:
      type: object
      properties:
        key:
          type: string
          description: A unique key used to reference the segment
        name:
          type: string
          description: A human-friendly name for the segment
        environmentId:
          type: string
          description: Environment ID of the segment
        environmentKey:
          type: string
          description: Environment key of the segment
        description:
          type: string
          description: Description of the segment
        creationDate:
          type: integer
          format: int64
          description: Creation date in milliseconds
        lastModifiedDate:
          type: integer
          format: int64
          description: Last modification date in milliseconds
        deleted:
          type: boolean
          description: Whether the segment is deleted
        tags:
          type: array
          items:
            type: string
          description: Tags for the segment
        unbounded:
          type: boolean
          description: Whether the segment is unbounded
        version:
          type: integer
          description: Version of the segment
        generation:
          type: integer
          description: Generation of the segment
        _links:
          $ref: '#/components/schemas/ParentAndSelfLinks'
      required:
        - key
        - name
      description: >-
        Segment representation for Views API - contains only fields actually
        used by the Views service
      title: ExpandedSegment
    ExpandedLinkedSegments:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/ExpandedSegment'
        totalCount:
          type: integer
      required:
        - items
        - totalCount
      description: >-
        Details on linked segments for a view - requires passing the
        'allSegments' expand field
      title: ExpandedLinkedSegments
    ExpandedMetric:
      type: object
      properties:
        key:
          type: string
          description: A unique key used to reference the metric
        name:
          type: string
          description: A human-friendly name for the metric
        creationDate:
          type: integer
          format: int64
          description: Creation date in milliseconds
        lastModified:
          type: integer
          format: int64
          description: Last modification date in milliseconds
        isActive:
          type: boolean
          description: Whether the metric is active
        eventKey:
          type: string
          description: Event key for the metric
        _id:
          type: string
          description: ID of the metric
        _versionId:
          type: string
          description: Version ID of the metric
        kind:
          type: string
          description: Kind of the Metric
        category:
          type: string
          description: Category of the Metric
        description:
          type: string
          description: Description of the Metric
        isNumeric:
          type: boolean
        lastSeen:
          type: integer
          format: int64
          description: Last seen date in milliseconds
        _links:
          $ref: '#/components/schemas/ParentAndSelfLinks'
      description: >-
        Metric representation for Views API - contains only fields actually used
        by the Views service
      title: ExpandedMetric
    ExpandedLinkedMetrics:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/ExpandedMetric'
        totalCount:
          type: integer
      required:
        - items
        - totalCount
      title: ExpandedLinkedMetrics
    ExpandedAIConfig:
      type: object
      properties:
        key:
          type: string
          description: A unique key used to reference the AI config
        name:
          type: string
          description: A human-friendly name for the AI config
        tags:
          type: array
          items:
            type: string
          description: Tags for the AI config
        description:
          type: string
          description: Description of the AI config
        version:
          type: integer
          description: Version of the AI config
        createdAt:
          type: integer
          format: int64
          description: Creation date in milliseconds
        updatedAt:
          type: integer
          format: int64
          description: Last modification date in milliseconds
        flagKey:
          type: string
          description: Key of the flag that this AI config is attached to
        _links:
          $ref: '#/components/schemas/ParentAndSelfLinks'
      description: >-
        AI Config representation for Views API - contains only fields actually
        used by the Views service
      title: ExpandedAIConfig
    ExpandedLinkedAIConfigs:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/ExpandedAIConfig'
        totalCount:
          type: integer
      required:
        - items
        - totalCount
      title: ExpandedLinkedAIConfigs
    ExpandedLinkedResourcesFlags:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/ExpandedFlag'
        totalCount:
          type: integer
      required:
        - items
        - totalCount
      title: ExpandedLinkedResourcesFlags
    ExpandedLinkedResourcesSegments:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/ExpandedSegment'
        totalCount:
          type: integer
      required:
        - items
        - totalCount
      title: ExpandedLinkedResourcesSegments
    ExpandedLinkedResourcesItems:
      type: object
      properties:
        flags:
          $ref: '#/components/schemas/ExpandedLinkedResourcesFlags'
        segments:
          $ref: '#/components/schemas/ExpandedLinkedResourcesSegments'
      required:
        - flags
      title: ExpandedLinkedResourcesItems
    ExpandedLinkedResources:
      type: object
      properties:
        items:
          $ref: '#/components/schemas/ExpandedLinkedResourcesItems'
        totalCount:
          type: integer
      required:
        - items
        - totalCount
      description: >-
        Details on linked resources for a view - requires passing the
        'allResources' expand field
      title: ExpandedLinkedResources
    View:
      type: object
      properties:
        _access:
          $ref: '#/components/schemas/ViewsAccessRep'
        _links:
          $ref: '#/components/schemas/ParentAndSelfLinks'
        id:
          type: string
          format: string
          description: Unique ID of this view
        accountId:
          type: string
          description: ID of the account that owns this view
        projectId:
          type: string
          description: ID of the project this view belongs to
        projectKey:
          type: string
          description: Key of the project this view belongs to
        key:
          type: string
          description: Unique key for the view within the account/project
        name:
          type: string
          description: Human-readable name for the view
        description:
          type: string
          description: Optional detailed description of the view
        generateSdkKeys:
          type: boolean
          description: Whether to generate SDK keys for this view. Defaults to false.
        version:
          type: integer
          description: Version number for tracking changes
        tags:
          type: array
          items:
            type: string
          description: Tags associated with this view
        createdAt:
          type: integer
          format: int64
        updatedAt:
          type: integer
          format: int64
        archived:
          type: boolean
          default: false
          description: Whether this view is archived
        archivedAt:
          type: integer
          format: int64
        deletedAt:
          type: integer
          format: int64
        deleted:
          type: boolean
          default: false
          description: Whether this view is deleted
        maintainer:
          $ref: '#/components/schemas/Maintainer'
        flagsSummary:
          $ref: '#/components/schemas/FlagsSummary'
        segmentsSummary:
          $ref: '#/components/schemas/SegmentsSummary'
        metricsSummary:
          $ref: '#/components/schemas/MetricsSummary'
        aiConfigsSummary:
          $ref: '#/components/schemas/AIConfigsSummary'
        resourceSummary:
          $ref: '#/components/schemas/ResourceSummary'
        flagsExpanded:
          $ref: '#/components/schemas/ExpandedLinkedFlags'
        segmentsExpanded:
          $ref: '#/components/schemas/ExpandedLinkedSegments'
        metricsExpanded:
          $ref: '#/components/schemas/ExpandedLinkedMetrics'
        aiConfigsExpanded:
          $ref: '#/components/schemas/ExpandedLinkedAIConfigs'
        resourcesExpanded:
          $ref: '#/components/schemas/ExpandedLinkedResources'
      required:
        - id
        - accountId
        - projectId
        - projectKey
        - key
        - name
        - description
        - generateSdkKeys
        - version
        - tags
        - createdAt
        - updatedAt
        - archived
        - deleted
      title: View
    Error:
      type: object
      properties:
        message:
          type: string
        code:
          type: string
      required:
        - message
        - code
      title: Error
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: Authorization

```

## SDK Code Examples

```python
import requests

url = "https://app.launchdarkly.com/api/v2/projects/default/views/my-view"

payload = {
    "name": "name",
    "description": "description",
    "generateSdkKeys": True,
    "maintainerId": "maintainerId",
    "maintainerTeamKey": "maintainerTeamKey",
    "tags": ["tags", "tags"],
    "archived": True
}
headers = {
    "LD-API-Version": "beta",
    "Authorization": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://app.launchdarkly.com/api/v2/projects/default/views/my-view';
const options = {
  method: 'PATCH',
  headers: {
    'LD-API-Version': 'beta',
    Authorization: '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"name":"name","description":"description","generateSdkKeys":true,"maintainerId":"maintainerId","maintainerTeamKey":"maintainerTeamKey","tags":["tags","tags"],"archived":true}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://app.launchdarkly.com/api/v2/projects/default/views/my-view"

	payload := strings.NewReader("{\n  \"name\": \"name\",\n  \"description\": \"description\",\n  \"generateSdkKeys\": true,\n  \"maintainerId\": \"maintainerId\",\n  \"maintainerTeamKey\": \"maintainerTeamKey\",\n  \"tags\": [\n    \"tags\",\n    \"tags\"\n  ],\n  \"archived\": true\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("LD-API-Version", "beta")
	req.Header.Add("Authorization", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://app.launchdarkly.com/api/v2/projects/default/views/my-view")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["LD-API-Version"] = 'beta'
request["Authorization"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"name\",\n  \"description\": \"description\",\n  \"generateSdkKeys\": true,\n  \"maintainerId\": \"maintainerId\",\n  \"maintainerTeamKey\": \"maintainerTeamKey\",\n  \"tags\": [\n    \"tags\",\n    \"tags\"\n  ],\n  \"archived\": true\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://app.launchdarkly.com/api/v2/projects/default/views/my-view")
  .header("LD-API-Version", "beta")
  .header("Authorization", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"name\",\n  \"description\": \"description\",\n  \"generateSdkKeys\": true,\n  \"maintainerId\": \"maintainerId\",\n  \"maintainerTeamKey\": \"maintainerTeamKey\",\n  \"tags\": [\n    \"tags\",\n    \"tags\"\n  ],\n  \"archived\": true\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://app.launchdarkly.com/api/v2/projects/default/views/my-view', [
  'body' => '{
  "name": "name",
  "description": "description",
  "generateSdkKeys": true,
  "maintainerId": "maintainerId",
  "maintainerTeamKey": "maintainerTeamKey",
  "tags": [
    "tags",
    "tags"
  ],
  "archived": true
}',
  'headers' => [
    'Authorization' => '<apiKey>',
    'Content-Type' => 'application/json',
    'LD-API-Version' => 'beta',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://app.launchdarkly.com/api/v2/projects/default/views/my-view");
var request = new RestRequest(Method.PATCH);
request.AddHeader("LD-API-Version", "beta");
request.AddHeader("Authorization", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"name\",\n  \"description\": \"description\",\n  \"generateSdkKeys\": true,\n  \"maintainerId\": \"maintainerId\",\n  \"maintainerTeamKey\": \"maintainerTeamKey\",\n  \"tags\": [\n    \"tags\",\n    \"tags\"\n  ],\n  \"archived\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "LD-API-Version": "beta",
  "Authorization": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "name",
  "description": "description",
  "generateSdkKeys": true,
  "maintainerId": "maintainerId",
  "maintainerTeamKey": "maintainerTeamKey",
  "tags": ["tags", "tags"],
  "archived": true
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://app.launchdarkly.com/api/v2/projects/default/views/my-view")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```