Edit File API

Update file entries including title, description, URL, and access permissions

Resources

Edit File API

Update existing file entries to change titles, descriptions, URLs, or access permissions. Keep your resource library accurate and current.

Update Info

Modify file details.

Change URL

Update download links.

Adjust Access

Modify role permissions.


Endpoint Overview

MUTATION/graphql

Update an existing file entry. Only provided fields will be modified; omitted fields retain their current values.

Authentication:Bearer Token
Required scopes:admin

Request Parameters

idInt!Required

The unique identifier of the file to update.

file.titleString

Updated display title.

file.descriptionString

Updated file description.

file.urlString

Updated download URL.

file.roles[Int]

Updated list of role IDs with access.


GraphQL Mutation

mutation editFile($id: Int!, $file: FileEdit!) {
  editFile(id: $id, file: $file) {
    id
    title
    description
    url
    updatedAt
  }
}

Variables:

{
  "id": 789,
  "file": {
    "title": "Windows VPN Client v2.5.1",
    "description": "Updated with bug fixes for connection stability.",
    "url": "https://downloads.example.com/vpn-client-2.5.1.exe"
  }
}

HTTP Request:

curl -X POST https://api.orbnet.com/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_ADMIN_TOKEN" \
  -d '{
    "query": "mutation editFile($id: Int!, $file: FileEdit!) { editFile(id: $id, file: $file) { id title url updatedAt } }",
    "variables": {
      "id": 789,
      "file": {
        "title": "Windows VPN Client v2.5.1",
        "url": "https://downloads.example.com/vpn-client-2.5.1.exe"
      }
    }
  }'

Response

200File Updated Successfully
{
  "data": {
    "editFile": {
      "id": "789",
      "title": "Windows VPN Client v2.5.1",
      "description": "Updated with bug fixes for connection stability.",
      "url": "https://downloads.example.com/vpn-client-2.5.1.exe",
      "updatedAt": "2024-01-16T09:00:00Z"
    }
  }
}
400File Not Found
{
  "errors": [
    {
      "message": "File with ID 789 not found",
      "path": ["editFile"],
      "extensions": {
        "code": "NOT_FOUND"
      }
    }
  ],
  "data": null
}

Common Updates

Version Update

Update to new file version.

URL Change

Point to new download location.

Fix Description

Correct information or typos.

Expand Access

Add more roles to permissions.


Best Practices

Version in Title

Update version number when file changes.

Test URL

Verify new URLs are accessible.

Update Description

Note what changed in new version.

Notify Users

Announce significant updates.



Partial Updates

Only include fields you want to change. Existing values are preserved for omitted fields.

View File Library

Review your current files before making updates.

View Files