Rename a file

Files of file fields. Upload in three steps: start an upload, send the bytes to the returned URL, then write the file id into the file field with /v1/records/mutate or attach it with /v1/files/{id}/attach. To remove a file, write the field's list without its id with /v1/records/mutate. Access to a file follows read access to its record and field. Changes the name a file shows and downloads with. Folders are refused, control characters are removed and the name is cut to 255 characters; a name without an extension keeps the file's current one, so "Offer" renames "Draft.pdf" to "Offer.pdf". Renaming a file in a record's file field is a record update: it appears in the record's activity like any change of the field, but leaves the record version unchanged. Renaming a pending file is possible for the person who uploaded it. An empty or invalid name answers 400 with recordFileNameInvalid.

Requires: update access to the record and the file field, or ownership of a pending upload

PATCH
/v1/files/{id}

Authorization

apiKeyAuth
x-api-key<token>

API key authentication. Create an API key in your user profile and include it in the x-api-key header.

In: header

Path Parameters

id*string

Id of the file.

Match^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://customermates.com/api/v1/files/497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "Content-Type: application/json" \  -d '{    "name": "Signed offer.pdf"  }'
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "typeId": "caab7c42-4ce7-4bd5-bbab-6017cec730b7",
  "fieldId": "84922011-b03d-4966-bc95-c5b49bc2e342",
  "recordId": "0470cfd4-dcf3-4d8c-ac28-58c6deeff25f",
  "name": "string",
  "mimeType": "string",
  "size": 9007199254740991,
  "status": "pending",
  "uploadedAt": "2019-08-24T14:15:22Z",
  "uploadedById": "e4e90afa-33ee-4f3f-ba8f-3fb33b13c87d",
  "extractionStatus": "pending"
}
{
  "error": {
    "kind": "validation",
    "issues": [
      {
        "code": "string",
        "path": [
          "string"
        ],
        "message": "string",
        "customCode": "recordNotFound",
        "entitlement": "string"
      }
    ],
    "retryable": true
  }
}
{
  "error": {
    "kind": "validation",
    "issues": [
      {
        "code": "string",
        "path": [
          "string"
        ],
        "message": "string",
        "customCode": "recordNotFound",
        "entitlement": "string"
      }
    ],
    "retryable": true
  }
}
{
  "error": {
    "kind": "validation",
    "issues": [
      {
        "code": "string",
        "path": [
          "string"
        ],
        "message": "string",
        "customCode": "recordNotFound",
        "entitlement": "string"
      }
    ],
    "retryable": true
  }
}
{
  "error": {
    "kind": "validation",
    "issues": [
      {
        "code": "string",
        "path": [
          "string"
        ],
        "message": "string",
        "customCode": "recordNotFound",
        "entitlement": "string"
      }
    ],
    "retryable": true
  }
}
{
  "error": {
    "kind": "validation",
    "issues": [
      {
        "code": "string",
        "path": [
          "string"
        ],
        "message": "string",
        "customCode": "recordNotFound",
        "entitlement": "string"
      }
    ],
    "retryable": true
  }
}
{
  "error": {
    "kind": "validation",
    "issues": [
      {
        "code": "string",
        "path": [
          "string"
        ],
        "message": "string",
        "customCode": "recordNotFound",
        "entitlement": "string"
      }
    ],
    "retryable": true
  }
}
{
  "error": {
    "kind": "validation",
    "issues": [
      {
        "code": "string",
        "path": [
          "string"
        ],
        "message": "string",
        "customCode": "recordNotFound",
        "entitlement": "string"
      }
    ],
    "retryable": true
  }
}
Empty