---
raw: true
search:
  tags:
    - Access
    - PATCH
seo:
  description: >-
    Updates supplied link fields when expectedRevision is… Reference for the
    PATCH /v1/spaces/{spaceId}/share-links/{linkId} endpoint in the Spacefast
    API.
sidebar:
  label: Update a share link
  badge: PATCH
title: Update a share link
type: openapi-operation
---
Updates supplied link fields when expectedRevision is current. A stale revision returns 409 with the current link; nested constraint fields patch independently and null clears one field. Changing capabilities or target to a commenting link the comments surface never shows returns 422 `comments_target_unavailable`.

`PATCH /v1/spaces/{spaceId}/share-links/{linkId}`

**Request body** (`application/json`, required)

- `expectedRevision` (integer, required)
- `name` (string)
- `landingPath` (string)
- `resources` (object)
- `capabilities` (string[])
- `constraints` (object)
- `target` (object)

Request body example:

```json
{
  "expectedRevision": 1,
  "name": "string",
  "landingPath": "string",
  "resources": {
    "include": [
      "string"
    ],
    "exclude": []
  },
  "capabilities": [
    "page.view"
  ],
  "constraints": {
    "notBefore": "2019-08-24T14:15:22Z",
    "expiresAt": "2019-08-24T14:15:22Z",
    "maxUses": 1,
    "requireVerifiedEmail": true,
    "frameOrigin": "string",
    "network": {
      "ipCidrs": [
        "string"
      ],
      "countries": [
        "st"
      ],
      "excludedCountries": [
        "st"
      ],
      "excludedUserAgentSubstrings": [
        "string"
      ]
    }
  },
  "target": {
    "kind": "live"
  }
}
```

**Responses**

- `200` — Response for status 200
- `default` — Problem details (RFC 9457). Any 4xx/5xx response is one \`application/problem+json\` document.

Response example, 200:

```json
{
  "$schema": "http://example.com",
  "data": {
    "id": "string",
    "spaceId": "string",
    "grantId": "string",
    "revision": 1,
    "name": "string",
    "landingPath": "string",
    "resources": {
      "include": [
        "string"
      ],
      "exclude": []
    },
    "capabilities": [
      "page.view"
    ],
    "constraints": {
      "notBefore": "2019-08-24T14:15:22Z",
      "expiresAt": "2019-08-24T14:15:22Z",
      "maxUses": 1,
      "requireVerifiedEmail": true,
      "network": {
        "ipCidrs": [
          "string"
        ],
        "countries": [
          "st"
        ],
        "excludedCountries": [
          "st"
        ],
        "excludedUserAgentSubstrings": [
          "string"
        ]
      },
      "frameOrigin": "string"
    },
    "target": {
      "kind": "live"
    },
    "createdBy": "string",
    "openCount": 0,
    "lastUsedAt": "2019-08-24T14:15:22Z",
    "revokedAt": "2019-08-24T14:15:22Z",
    "createdAt": "2019-08-24T14:15:22Z",
    "active": true
  }
}
```
