Skip to main content
PUT
/
api
/
access
/
:accessID
Update Access
curl --request PUT \
  --url https://api.example.com/api/access/:accessID \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "subnets": [
    {}
  ],
  "ips": [
    {}
  ],
  "expires": "<string>",
  "public": true,
  "oneTimeUse": true,
  "ttl": 123,
  "enableTTL": true
}
'
{
  "message": "<string>",
  "access": {
    "id": 123,
    "fileID": 123,
    "name": "<string>",
    "link": "<string>",
    "subnets": [
      {}
    ],
    "ips": [
      {}
    ],
    "expires": "<string>",
    "public": true,
    "oneTimeUse": true,
    "ttl": 123,
    "enableTTL": true
  },
  "401 Unauthorized": {},
  "400 Bad Request": {},
  "404 Not Found": {},
  "403 Forbidden": {},
  "500 Internal Server Error": {}
}
Update an existing access record with new permissions and restrictions.

Authentication

This endpoint requires authentication. Include a valid JWT token in the Authorization header.

Path Parameters

accessID
integer
required
The unique identifier of the access record to update

Request Body

name
string
A descriptive name for this access link
subnets
array
Array of subnet CIDR ranges allowed to access the file
ips
array
Array of specific IP addresses allowed to access the file
expires
string
ISO 8601 timestamp when the access link expires
public
boolean
Whether the access link is publicly accessible without restrictions
oneTimeUse
boolean
Whether the access link can only be used once
ttl
integer
Time-to-live in seconds for the access link
enableTTL
boolean
Whether to enable the TTL restriction

Response

message
string
Success message confirming access update
access
object
The updated access record

Error Responses

401 Unauthorized
object
User not authenticated
400 Bad Request
object
Invalid access ID or request body
404 Not Found
object
Access record or file not found
403 Forbidden
object
User doesn’t own the file
500 Internal Server Error
object
Failed to update access record
curl -X PUT https://api.defdrive.com/api/access/456 \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Team Access",
    "subnets": ["192.168.1.0/24", "10.0.0.0/8"],
    "ips": ["10.0.0.50", "10.0.0.51"],
    "expires": "2027-06-30T23:59:59Z",
    "public": false,
    "oneTimeUse": false,
    "ttl": 7200,
    "enableTTL": true
  }'

Build docs developers (and LLMs) love